Skip to content

Commit

Permalink
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternat…
Browse files Browse the repository at this point in the history
…ives (#102816)
  • Loading branch information
iritkatriel authored Mar 19, 2023
1 parent 3adb23a commit ad77b80
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 342 deletions.
8 changes: 2 additions & 6 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,7 @@ dummy_func(
}
assert(exc && PyExceptionInstance_Check(exc));
Py_INCREF(exc);
PyObject *typ = Py_NewRef(PyExceptionInstance_Class(exc));
PyObject *tb = PyException_GetTraceback(exc);
_PyErr_Restore(tstate, typ, exc, tb);
_PyErr_SetRaisedException(tstate, exc);
goto exception_unwind;
}

Expand All @@ -791,9 +789,7 @@ dummy_func(
}
else {
Py_INCREF(exc);
PyObject *typ = Py_NewRef(PyExceptionInstance_Class(exc));
PyObject *tb = PyException_GetTraceback(exc);
_PyErr_Restore(tstate, typ, exc, tb);
_PyErr_SetRaisedException(tstate, exc);
goto exception_unwind;
}
}
Expand Down
Loading

0 comments on commit ad77b80

Please sign in to comment.