diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-03-19 15:17:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 15:17:59 (GMT) |
commit | ad77b80b0542a71eff54d1a193bd044a71e8e00b (patch) | |
tree | 088716f4cb0871b694facae033b14dcbdc5a6b44 /Python/bytecodes.c | |
parent | 3adb23a17d25e36bd80874e860835182d851623f (diff) | |
download | cpython-ad77b80b0542a71eff54d1a193bd044a71e8e00b.zip cpython-ad77b80b0542a71eff54d1a193bd044a71e8e00b.tar.gz cpython-ad77b80b0542a71eff54d1a193bd044a71e8e00b.tar.bz2 |
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (#102816)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 74582ec..6c44870 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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; } } |