From: Raymond Hettinger Date: Fri, 18 Jan 2008 00:10:42 +0000 (+0000) Subject: clearcache() needs to remove the dict as well as clear it. X-Git-Tag: v2.6a1~569 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18e08e5e6169d8780a5cb1e53dfe972902caf61c;p=python clearcache() needs to remove the dict as well as clear it. --- diff --git a/Modules/_struct.c b/Modules/_struct.c index 41cdca7062..6149964ecc 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -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; }