mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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.
This commit is contained in:
parent
a624040d72
commit
1994969c15
4 changed files with 47 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue