summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 6e36690..289ed79 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -512,6 +512,12 @@ throw_here:
}
PyErr_Restore(typ, val, tb);
+ if (gen->gi_exc_state.exc_type) {
+ Py_INCREF(gen->gi_exc_state.exc_type);
+ Py_XINCREF(gen->gi_exc_state.exc_value);
+ Py_XINCREF(gen->gi_exc_state.exc_traceback);
+ _PyErr_ChainExceptions(gen->gi_exc_state.exc_type, gen->gi_exc_state.exc_value, gen->gi_exc_state.exc_traceback);
+ }
return gen_send_ex(gen, Py_None, 1, 0);
failed_throw: