mirror of
https://github.com/python/cpython
synced 2024-09-16 01:31:10 +00:00
Issue #22906: Do incref before SetCause/SetContext
This commit is contained in:
parent
582d3fb1a5
commit
18c30a29f8
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue