mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Python/) (#102193)
This commit is contained in:
parent
85b1fc1fc5
commit
4c87537efb
8 changed files with 42 additions and 72 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue