comparison Python/errors.c @ 37761:833f384ebd41 legacy-trunk

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?
author Thomas Wouters <thomas@python.org>
date Sat, 15 Apr 2006 23:27:28 +0000
parents 2f3f2e32dfd9
children 7bbb9b5f7adc
comparison
equal deleted inserted replaced
37760:9eb4dc1cc83e 37761:833f384ebd41
602 PyFile_WriteString(className, f); 602 PyFile_WriteString(className, f);
603 if (v && v != Py_None) { 603 if (v && v != Py_None) {
604 PyFile_WriteString(": ", f); 604 PyFile_WriteString(": ", f);
605 PyFile_WriteObject(v, f, 0); 605 PyFile_WriteObject(v, f, 0);
606 } 606 }
607 Py_DECREF(moduleName);
607 } 608 }
608 PyFile_WriteString(" in ", f); 609 PyFile_WriteString(" in ", f);
609 PyFile_WriteObject(obj, f, 0); 610 PyFile_WriteObject(obj, f, 0);
610 PyFile_WriteString(" ignored\n", f); 611 PyFile_WriteString(" ignored\n", f);
611 PyErr_Clear(); /* Just in case */ 612 PyErr_Clear(); /* Just in case */