mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
More detailed error message about exception in __del__
This commit is contained in:
parent
b7fc304109
commit
22a85e5308
1 changed files with 6 additions and 3 deletions
|
|
@ -406,9 +406,12 @@ instance_dealloc(inst)
|
|||
if (res == NULL) {
|
||||
PyObject *f = sysget("stderr");
|
||||
err_clear();
|
||||
if (f != NULL)
|
||||
writestring(
|
||||
"exception in __del__ method ignored\n", f);
|
||||
if (f != NULL) {
|
||||
writestring("exception in ", f);
|
||||
writestring(PyString_AsString(
|
||||
inst->in_class->cl_name), f);
|
||||
writestring(".__del__() ignored\n", f);
|
||||
}
|
||||
}
|
||||
else
|
||||
DECREF(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue