Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80e4dbe

Browse files
committed
Issue 22906: Increment refcount after PyException_SetContext
1 parent e9ad5a5 commit 80e4dbe

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Objects/genobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
151151
PyErr_NormalizeException(&exc, &val2, &tb);
152152
PyException_SetCause(val2, val);
153153
PyException_SetContext(val2, val);
154+
Py_INCREF(val);
154155
PyErr_Restore(exc, val2, tb);
155156
}
156157
}

0 commit comments

Comments
 (0)