Closed BrendanSimon closed 3 years ago
There are several issues here:
__qualname__
is absent in Python 2.7 (so error message was failing)int
and long
int
checks are hard codedThe error message was easy enough to fix. Now to figure out how to fix the rest.
Okay, the problem is "fixed":
Flag
works fine, as its values are not directly tied to a type and so can be int
or long
as needed. (Python 2.7)IntFlag
works fine for defining any members that fit within the the C long type (Python2.7)I didn't see any issues in the Python 3 series.
The following code works on Python 3 but not Python 2.
I get the error:
From what I can deduce, the problem is with the most significant bit of the natural integer size of the system (bit-31 for 32-bit system, or bit-63 for 64-bit system). I can set that
msb
if that's the only bit present in the integer mask, but if others are set then the exception occurs.On further investigation, anything that is a Python
long
type (Python 2) is not settable unless it is the only bit in the mask.On Python 2.7 (32-bit arm linux), I get the following output and error message.
On Python 3.7 (64-bit linux), I get the following output.