selectable_int: replace bit_count with bit_length
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 16 Sep 2022 16:54:04 +0000 (19:54 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 16 Sep 2022 16:54:04 +0000 (19:54 +0300)
src/openpower/decoder/selectable_int.py

index 02c8839ac779a430949ea5e6ad7eefe718416bd9..c4e45865c14f232af1a94542fa8989f1fb673eb4 100644 (file)
@@ -440,7 +440,7 @@ class SelectableInt:
                 bits.append(bit)
 
             if isinstance(value, int):
-                if value.bit_count() > len(bits):
+                if value.bit_length() > len(bits):
                     raise ValueError(value)
                 value = SelectableInt(value=value, bits=len(bits))
             if not isinstance(value, SelectableInt):