mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
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?
This commit is contained in:
parent
81b092d0e6
commit
b8f81d4863
3 changed files with 35 additions and 21 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue