T
Terry Carroll
If I do the following code, whether in the interactive session or in a
file, I get a FutureWarning:
<stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
Okay; that's expected. No problem, I'll just turn off the
FutureWarning. Here's the results from within an interactive session:
Note that no warning is produced. Great; that's what I wanted.
But now, the same thing, but executing a file, rather than
interactively:
[begin-quote]
C:\test\misc>cat testfw.py
import warnings
warnings.filterwarnings('ignore', "hex/oct constants", FutureWarning)
x = 0xffffffff
C:\test\misc>python testfw.py
testfw.py:3: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
x = 0xffffffff
[end-quote]
Why won't the filterwarnings call suppress this?
file, I get a FutureWarning:
<stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
Okay; that's expected. No problem, I'll just turn off the
FutureWarning. Here's the results from within an interactive session:
Note that no warning is produced. Great; that's what I wanted.
But now, the same thing, but executing a file, rather than
interactively:
[begin-quote]
C:\test\misc>cat testfw.py
import warnings
warnings.filterwarnings('ignore', "hex/oct constants", FutureWarning)
x = 0xffffffff
C:\test\misc>python testfw.py
testfw.py:3: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
x = 0xffffffff
[end-quote]
Why won't the filterwarnings call suppress this?