diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-02-28 11:50:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 11:50:52 (GMT) |
commit | 4c87537efb5fd28b4e4ee9631076ed5953720156 (patch) | |
tree | 8c8bf4b1c849bc47dc28561d0653c95b33e357db /Python/ceval_gil.c | |
parent | 85b1fc1fc5a2e49d521382eaf5e7793175d00371 (diff) | |
download | cpython-4c87537efb5fd28b4e4ee9631076ed5953720156.zip cpython-4c87537efb5fd28b4e4ee9631076ed5953720156.tar.gz cpython-4c87537efb5fd28b4e4ee9631076ed5953720156.tar.bz2 |
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Python/) (#102193)
Diffstat (limited to 'Python/ceval_gil.c')
-rw-r--r-- | Python/ceval_gil.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c index 1bf2233..749d814 100644 --- a/Python/ceval_gil.c +++ b/Python/ceval_gil.c @@ -2,7 +2,7 @@ #include "Python.h" #include "pycore_atomic.h" // _Py_atomic_int #include "pycore_ceval.h" // _PyEval_SignalReceived() -#include "pycore_pyerrors.h" // _PyErr_Fetch() +#include "pycore_pyerrors.h" // _PyErr_GetRaisedException() #include "pycore_pylifecycle.h" // _PyErr_Print() #include "pycore_initconfig.h" // _PyStatus_OK() #include "pycore_interp.h" // _Py_RunGC() @@ -870,10 +870,9 @@ _Py_FinishPendingCalls(PyThreadState *tstate) } if (make_pending_calls(tstate->interp) < 0) { - PyObject *exc, *val, *tb; - _PyErr_Fetch(tstate, &exc, &val, &tb); + PyObject *exc = _PyErr_GetRaisedException(tstate); PyErr_BadInternalCall(); - _PyErr_ChainExceptions(exc, val, tb); + _PyErr_ChainExceptions1(exc); _PyErr_Print(tstate); } } |