mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Be a bit more careful with printing a warning for a failed __del__.
This commit is contained in:
parent
2a516c8f2c
commit
ad8997887b
1 changed files with 5 additions and 2 deletions
|
@ -404,8 +404,11 @@ instance_dealloc(inst)
|
||||||
object *res = call_object(del, (object *)NULL);
|
object *res = call_object(del, (object *)NULL);
|
||||||
DECREF(del);
|
DECREF(del);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
writestring("exception in __del__ method ignored\n",
|
PyObject *f = sysget("stderr");
|
||||||
sysget("stderr"));
|
err_clear();
|
||||||
|
if (f != NULL)
|
||||||
|
writestring(
|
||||||
|
"exception in __del__ method ignored\n", f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DECREF(res);
|
DECREF(res);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue