FutureWarning/OverFlow error and 0xffff0000
Richard Jones
rjones at ekit-inc.com
Thu Feb 20 17:43:05 EST 2003
My code has a couple of instances of 0xffff0000 in it - they're bitmask flags
to windows calls. Up until 2.3, all was well. Now in 2.3, I get warnings
"FutureWarning: hex/oct constants > sys.maxint will return positive values in
Python 2.4 and up" about that value. The first solution I came up with was to
suppress the warning before I import the specific module that has the
literal.
I fleetingly noticed someone suggest that I use a long int literal instead:
0xffff0000L
No dice. On older versions of Python, this generates an "OverflowError: long
int too large to convert to int".
Just thought I'd let people know that the long-int solution is not viable :(
Richard
More information about the Python-list
mailing list