summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-10 19:09:46 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-10 19:09:46 (GMT)
commit18c30a29f86dc41f96a572b6ec3f7bd6824f6e6a (patch)
treea125f8af06f101e333ae37638ca11fa3473be8f9 /Objects
parent582d3fb1a5be2ffced3ca651227f486efbe1f477 (diff)
downloadcpython-18c30a29f86dc41f96a572b6ec3f7bd6824f6e6a.zip
cpython-18c30a29f86dc41f96a572b6ec3f7bd6824f6e6a.tar.gz
cpython-18c30a29f86dc41f96a572b6ec3f7bd6824f6e6a.tar.bz2
Issue #22906: Do incref before SetCause/SetContext
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 149e545..82b629c 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -149,9 +149,9 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
"generator raised StopIteration");
PyErr_Fetch(&exc, &val2, &tb);
PyErr_NormalizeException(&exc, &val2, &tb);
+ Py_INCREF(val);
PyException_SetCause(val2, val);
PyException_SetContext(val2, val);
- Py_INCREF(val);
PyErr_Restore(exc, val2, tb);
}
}