summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 37ffb56..6ac622b 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -3315,7 +3315,12 @@
assert(val && PyExceptionInstance_Check(val));
exc = PyExceptionInstance_Class(val);
tb = PyException_GetTraceback(val);
- Py_XDECREF(tb);
+ if (tb == NULL) {
+ tb = Py_None;
+ }
+ else {
+ Py_DECREF(tb);
+ }
assert(PyLong_Check(lasti));
(void)lasti; // Shut up compiler warning if asserts are off
PyObject *stack[4] = {NULL, exc, val, tb};