summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/ceval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 5a8f503..731e93f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2255,7 +2255,11 @@ eval_frame(PyFrameObject *f)
set_exc_info(tstate,
exc, val, tb);
}
- PUSH(tb);
+ if (tb == NULL) {
+ Py_INCREF(Py_None);
+ PUSH(Py_None);
+ } else
+ PUSH(tb);
PUSH(val);
PUSH(exc);
}