summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 01cd44ae59..49e2adeaa0 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -261,6 +261,11 @@ gen_throw(PyGenObject *gen, PyObject *args)
val = typ;
typ = PyExceptionInstance_Class(typ);
Py_INCREF(typ);
+
+ if (tb == NULL) {
+ /* Returns NULL if there's no traceback */
+ tb = PyException_GetTraceback(val);
+ }
}
}
else {