summaryrefslogtreecommitdiffstats
path: root/Lib/warnings.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-06-28 00:01:59 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-06-28 00:01:59 (GMT)
commit7ab4b8d3a2e7e91f742a1339a5b8d2988f4b81b6 (patch)
tree940fba46823c8435d0ffd637e48ef49d7a83bf02 /Lib/warnings.py
parentf23e3744412ac8943bddaace3dc0e85522518319 (diff)
downloadcpython-7ab4b8d3a2e7e91f742a1339a5b8d2988f4b81b6.zip
cpython-7ab4b8d3a2e7e91f742a1339a5b8d2988f4b81b6.tar.gz
cpython-7ab4b8d3a2e7e91f742a1339a5b8d2988f4b81b6.tar.bz2
Merged revisions 77402,77505,77510 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77402 | brett.cannon | 2010-01-09 20:56:19 -0600 (Sat, 09 Jan 2010) | 12 lines 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. ........ r77505 | brett.cannon | 2010-01-14 14:00:28 -0600 (Thu, 14 Jan 2010) | 7 lines The silencing of DeprecationWarning was not taking -3 into consideration. Since Py3K warnings are DeprecationWarning by default this was causing -3 to essentially be a no-op. Now DeprecationWarning is only silenced if -3 is not used. Closes issue #7700. Thanks Ezio Melotti and Florent Xicluna for patch help. ........ r77510 | brett.cannon | 2010-01-14 19:31:45 -0600 (Thu, 14 Jan 2010) | 1 line Remove C++/C99-style comments. ........
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r--Lib/warnings.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py
index 9de2c67..ec835b1 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -371,8 +371,10 @@ except ImportError:
# Module initialization
_processoptions(sys.warnoptions)
if not _warnings_defaults:
- simplefilter("ignore", category=PendingDeprecationWarning, append=1)
- simplefilter("ignore", category=ImportWarning, append=1)
+ silence = [ImportWarning, PendingDeprecationWarning]
+ silence.append(DeprecationWarning)
+ for cls in silence:
+ simplefilter("ignore", category=cls)
bytes_warning = sys.flags.bytes_warning
if bytes_warning > 1:
bytes_action = "error"