summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-18 00:10:42 +0000
committerRaymond Hettinger <python@rcn.com>2008-01-18 00:10:42 +0000
commit18e08e5e6169d8780a5cb1e53dfe972902caf61c (patch)
tree1213c997b122f3c28593334d02523043cb3eb6e8
parent64cd1e2d9122ffd5153bc52b7a7e1a117210043b (diff)
downloadcpython-git-18e08e5e6169d8780a5cb1e53dfe972902caf61c.tar.gz
clearcache() needs to remove the dict as well as clear it.
-rw-r--r--Modules/_struct.c3
1 files changed, 1 insertions, 2 deletions
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;
}