why doesn't this filter the warning?
jepler at unpythonic.net
Mon Oct 18 03:35:54 CEST 2004
On Sun, Oct 17, 2004 at 06:18:06PM -0700, Terry Carroll wrote:
> Why won't the filterwarnings call suppress this?
The warning is produced at the time the code is *parsed*, not when it is
*executed*. You could suppress the warning in an imported module by
putting the suppression above the import of the problem module, for
This use of 'compile' to produce a code object which is subsequently
called demonstrates the point:
>>> c = compile("0xffffffff", "<string>", "eval")
<string>:0: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
Or, without using weird functions not used from day to day, so does
>>> def f(): return 0xffffffff
<stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list