Kaydet (Commit) ad899788 authored tarafından Guido van Rossum's avatar Guido van Rossum

Be a bit more careful with printing a warning for a failed __del__.

üst 2a516c8f
...@@ -404,8 +404,11 @@ instance_dealloc(inst) ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment