mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)
This commit is contained in:
parent
3adb23a17d
commit
ad77b80b05
4 changed files with 334 additions and 342 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue