summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c7
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);