summaryrefslogtreecommitdiffstats
path: root/Lib/warnings.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-09-04 18:24:04 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-09-04 18:24:04 (GMT)
commitef0e6c3b0485e83444b15c07f9cb1d905203791a (patch)
tree60c853299db07d4639f9c379ef5849b28be3d2d9 /Lib/warnings.py
parentd6399d2d19ef665a2893089be12e2214f73b643b (diff)
downloadcpython-ef0e6c3b0485e83444b15c07f9cb1d905203791a.zip
cpython-ef0e6c3b0485e83444b15c07f9cb1d905203791a.tar.gz
cpython-ef0e6c3b0485e83444b15c07f9cb1d905203791a.tar.bz2
_warnings exposed two variables with the name 'default_action' and
'once_registry'. This is bad as the warnings module had variables named 'defaultaction' and 'onceregistry' which are what people should be looking at (technically those variables shouldn't be mucked with as they are undocumented, but we all know better than to believe that isn't happening). So the variables from _warnings have been renamed to come off as private and to avoid confusion over what variable should be used. Closes issue #9766. Thanks to Antoine Pitrou for the discovery.
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r--Lib/warnings.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py
index ec835b1..a81aab3 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -357,10 +357,10 @@ class catch_warnings(object):
# If either if the compiled regexs are None, match anything.
_warnings_defaults = False
try:
- from _warnings import (filters, default_action, once_registry,
+ from _warnings import (filters, _defaultaction, _onceregistry,
warn, warn_explicit)
- defaultaction = default_action
- onceregistry = once_registry
+ defaultaction = _defaultaction
+ onceregistry = _onceregistry
_warnings_defaults = True
except ImportError:
filters = []