diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-12-08 20:08:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 20:08:06 (GMT) |
commit | 2109f7880b65755329a877da3a7f8a362de07350 (patch) | |
tree | 953b1f360ded971faf1ecdf5dd4153656ac181a4 /Python/errors.c | |
parent | 7778116c2f573edf320bd55301137a968e4339d8 (diff) | |
download | cpython-2109f7880b65755329a877da3a7f8a362de07350.zip cpython-2109f7880b65755329a877da3a7f8a362de07350.tar.gz cpython-2109f7880b65755329a877da3a7f8a362de07350.tar.bz2 |
bpo-45711: Remove unnecessary normalization of exc_info (GH-29922)
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Python/errors.c b/Python/errors.c index 0a8b5a2..44d2773 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -647,26 +647,6 @@ _PyErr_ChainStackItem(_PyErr_StackItem *exc_info) PyObject *typ, *val, *tb; _PyErr_Fetch(tstate, &typ, &val, &tb); - PyObject *typ2, *val2, *tb2; - typ2 = exc_info->exc_type; - val2 = exc_info->exc_value; - tb2 = exc_info->exc_traceback; -#ifdef Py_DEBUG - PyObject *typ2_before = typ2; - PyObject *val2_before = val2; - PyObject *tb2_before = tb2; -#endif - _PyErr_NormalizeException(tstate, &typ2, &val2, &tb2); -#ifdef Py_DEBUG - /* exc_info should already be normalized */ - assert(typ2 == typ2_before); - assert(val2 == val2_before); - assert(tb2 == tb2_before); -#endif - if (tb2 != NULL) { - PyException_SetTraceback(val2, tb2); - } - /* _PyErr_SetObject sets the context from PyThreadState. */ _PyErr_SetObject(tstate, typ, val); Py_DECREF(typ); // since _PyErr_Occurred was true |