summaryrefslogtreecommitdiff
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-02-11 00:15:46 -0800
committerLarry Hastings <larry@hastings.org>2014-02-11 00:15:46 -0800
commit3f99504c08ebca685271c32289f8907bc456e1fc (patch)
treedeb0b2d3284cec1323ad0da34f96107ea3f64576 /Objects/moduleobject.c
parent4cce8f2f40cc15235f44b3a47fec0444ed75e9fe (diff)
parent06847d9c8c30715c077e083de1c511e399af75f1 (diff)
downloadcpython-git-3f99504c08ebca685271c32289f8907bc456e1fc.tar.gz
Merge Python 3.4.0rc1 release branch.
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index d59475e2f3..682171070e 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -299,6 +299,14 @@ PyModule_GetState(PyObject* m)
void
_PyModule_Clear(PyObject *m)
{
+ PyObject *d = ((PyModuleObject *)m)->md_dict;
+ if (d != NULL)
+ _PyModule_ClearDict(d);
+}
+
+void
+_PyModule_ClearDict(PyObject *d)
+{
/* To make the execution order of destructors for global
objects a bit more predictable, we first zap all objects
whose name starts with a single underscore, before we clear
@@ -308,11 +316,6 @@ _PyModule_Clear(PyObject *m)
Py_ssize_t pos;
PyObject *key, *value;
- PyObject *d;
-
- d = ((PyModuleObject *)m)->md_dict;
- if (d == NULL)
- return;
/* First, clear only names starting with a single underscore */
pos = 0;