diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-01-10 02:56:19 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-01-10 02:56:19 (GMT) |
commit | 6fdd3dcb6a9998dbe7b707d7a3726733cc03681a (patch) | |
tree | 35f061054f51f3beffbde6edc85657dcbbddec97 /Lib/warnings.py | |
parent | 3ad57e2625601701b1a98324890095f411965af3 (diff) | |
download | cpython-6fdd3dcb6a9998dbe7b707d7a3726733cc03681a.zip cpython-6fdd3dcb6a9998dbe7b707d7a3726733cc03681a.tar.gz cpython-6fdd3dcb6a9998dbe7b707d7a3726733cc03681a.tar.bz2 |
DeprecationWarning is now silent by default.
This was originally suggested by Guido, discussed on the stdlib-sig mailing
list, and given the OK by Guido directly to me. What this change essentially
means is that Python has taken a policy of silencing warnings that are only
of interest to developers by default. This should prevent users from seeing
warnings which are triggered by an application being run against a new
interpreter before the app developer has a chance to update their code.
Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin
for helping with the issue.
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r-- | Lib/warnings.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py index 8d46cd6..a88e7ba 100644 --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -383,8 +383,8 @@ except ImportError: # Module initialization _processoptions(sys.warnoptions) if not _warnings_defaults: - simplefilter("ignore", category=PendingDeprecationWarning, append=1) - simplefilter("ignore", category=ImportWarning, append=1) + for cls in (DeprecationWarning, PendingDeprecationWarning, ImportWarning): + simplefilter("ignore", category=cls, append=True) bytes_warning = sys.flags.bytes_warning if bytes_warning > 1: bytes_action = "error" |