summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-09-04 18:24:04 +0000
committerBrett Cannon <bcannon@gmail.com>2010-09-04 18:24:04 +0000
commitef0e6c3b0485e83444b15c07f9cb1d905203791a (patch)
tree60c853299db07d4639f9c379ef5849b28be3d2d9 /Python
parentd6399d2d19ef665a2893089be12e2214f73b643b (diff)
downloadcpython-git-ef0e6c3b0485e83444b15c07f9cb1d905203791a.tar.gz
_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 'Python')
-rw-r--r--Python/_warnings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 63bcbffea9..a4e9d48e8e 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -945,13 +945,13 @@ _PyWarnings_Init(void)
if (_once_registry == NULL)
return NULL;
Py_INCREF(_once_registry);
- if (PyModule_AddObject(m, "once_registry", _once_registry) < 0)
+ if (PyModule_AddObject(m, "_onceregistry", _once_registry) < 0)
return NULL;
_default_action = PyUnicode_FromString("default");
if (_default_action == NULL)
return NULL;
- if (PyModule_AddObject(m, "default_action", _default_action) < 0)
+ if (PyModule_AddObject(m, "_defaultaction", _default_action) < 0)
return NULL;
return m;
}