diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-04-25 22:33:36 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-04-25 22:33:36 (GMT) |
commit | 1994969c15a055d2f9479d3bc10fb6304b2979ed (patch) | |
tree | 2a3cf51468cd824600a531482ff11e04fbdd29a7 /Lib/warnings.py | |
parent | a624040d72b7a83bab4737fdfe14b747b530f858 (diff) | |
download | cpython-1994969c15a055d2f9479d3bc10fb6304b2979ed.zip cpython-1994969c15a055d2f9479d3bc10fb6304b2979ed.tar.gz cpython-1994969c15a055d2f9479d3bc10fb6304b2979ed.tar.bz2 |
When DeprecationWarning was silenced by default, it also silenced any use of -Q
by default as well. This change fixes that by treating -Q like -3 when it comes
to DeprecationWarning; using it causes the silencing to not occur.
Fixes issue #7319.
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r-- | Lib/warnings.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py index 134ba13..08b70af 100644 --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -384,7 +384,8 @@ except ImportError: _processoptions(sys.warnoptions) if not _warnings_defaults: silence = [ImportWarning, PendingDeprecationWarning] - if not sys.py3kwarning: # Don't silence DeprecationWarning if -3 was used. + # Don't silence DeprecationWarning if -3 or -Q was used. + if not sys.py3kwarning and not sys.flags.division_warning: silence.append(DeprecationWarning) for cls in silence: simplefilter("ignore", category=cls) |