diff options
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 5776898..191b556 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -404,8 +404,11 @@ instance_dealloc(inst) object *res = call_object(del, (object *)NULL); DECREF(del); if (res == NULL) { - writestring("exception in __del__ method ignored\n", - sysget("stderr")); + PyObject *f = sysget("stderr"); + err_clear(); + if (f != NULL) + writestring( + "exception in __del__ method ignored\n", f); } else DECREF(res); |