summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-15 23:27:28 +0000
committerThomas Wouters <thomas@python.org>2006-04-15 23:27:28 +0000
commit0683c9896e67e6c1633025dccd2d8c76d37576da (patch)
treebe686dadd95c49681c82643c3e969f68f4cac12e /Python/errors.c
parent5921d2df7ddcca0b72d167f802d7d8a4afef7a02 (diff)
downloadcpython-0683c9896e67e6c1633025dccd2d8c76d37576da.tar.gz
Add missing DECREF to PyErr_WriteUnraisable(). That function reports
exceptions that can't be raised any further, because (for instance) they occur in __del__ methods. The coroutine tests in test_generators was triggering this leak. Remove the leakers' testcase, and add a simpler testcase that explicitly tests this leak to test_generators. test_generators now no longer leaks at all, on my machine. This fix may also solve other leaks, but my full refleakhunting run is still busy, so who knows?
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 25deaa6919..275a0656f6 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -604,6 +604,7 @@ PyErr_WriteUnraisable(PyObject *obj)
PyFile_WriteString(": ", f);
PyFile_WriteObject(v, f, 0);
}
+ Py_DECREF(moduleName);
}
PyFile_WriteString(" in ", f);
PyFile_WriteObject(obj, f, 0);