diff --git a/proto/ei-scanner b/proto/ei-scanner index ca11203..ae42b0c 100755 --- a/proto/ei-scanner +++ b/proto/ei-scanner @@ -277,8 +277,11 @@ class Enum: if self.is_bitfield: if e.value < 0: raise ValueError("Bitmasks must not be less than zero") - if e.value.bit_count() > 1: - raise ValueError("Bitmasks must have exactly one bit set") + try: + if e.value.bit_count() > 1: + raise ValueError("Bitmasks must have exactly one bit set") + except AttributeError: + pass # bit_count() requires Python 3.10 self.entries.append(entry)