diff --git a/Python/ceval.c b/Python/ceval.c index ea1a78590b7..0b2f924a84d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1189,6 +1189,10 @@ call_exc_trace(p_trace, p_newtrace, f) object *type, *value, *traceback, *arg; int err; err_get(&type, &value); + if (value == NULL) { + value = None; + INCREF(value); + } traceback = tb_fetch(); arg = newtupleobject(3); if (arg == NULL)