]> granicus.if.org Git - python/commitdiff
clearcache() needs to remove the dict as well as clear it.
authorRaymond Hettinger <python@rcn.com>
Fri, 18 Jan 2008 00:10:42 +0000 (00:10 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 18 Jan 2008 00:10:42 +0000 (00:10 +0000)
Modules/_struct.c

index 41cdca706241e519f17c87dd610a45bac0dcafd3..6149964eccf2da9ba4affc229b8a086f62970247 100644 (file)
@@ -1887,8 +1887,7 @@ PyDoc_STRVAR(clearcache_doc,
 static PyObject *
 clearcache(PyObject *self)
 {
-       if (cache != NULL)
-               PyDict_Clear(cache);
+       Py_CLEAR(cache);
        Py_RETURN_NONE;
 }