diff Python/_warnings.c @ 64438:1b5ee6e845cd

_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.
author Brett Cannon <bcannon@gmail.com>
date Sat, 04 Sep 2010 18:24:04 +0000
parents fa2d9720a66c
children 39b9e9de372b
line wrap: on
line diff
--- a/Python/_warnings.c	Sat Sep 04 17:46:44 2010 +0000
+++ b/Python/_warnings.c	Sat Sep 04 18:24:04 2010 +0000
@@ -945,13 +945,13 @@
     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;
 }