Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modules/_lsprof.c
  • Loading branch information
iritkatriel committed Feb 24, 2023
commit 3cb6039d5fca4d32f98cb4a89effc15d97ca827c
5 changes: 2 additions & 3 deletions Modules/_lsprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
* exception, and some of the code under here assumes that
* PyErr_* is its own to mess around with, so we have to
* save and restore any current exception. */
PyObject *last_type, *last_value, *last_tb;
PyErr_Fetch(&last_type, &last_value, &last_tb);
PyObject *exc = PyErr_GetRaisedException();

profEntry = getEntry(pObj, key);
if (profEntry == NULL) {
Expand All @@ -374,7 +373,7 @@ ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
initContext(pObj, pContext, profEntry);

restorePyerr:
PyErr_Restore(last_type, last_value, last_tb);
PyErr_SetRaisedException(exc);
}

static void
Expand Down