From 7a22e148468e82ea27838959a7e5ea6666276098 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Thu, 2 Dec 2021 12:34:26 +0000 Subject: [PATCH 1/3] bpo-45711: Remove unnecessary normalization of exc_info --- Python/errors.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Python/errors.c b/Python/errors.c index 0a8b5a257fb2c7..44d2773acdb5cd 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 From ddbb27dcf0af4fe013badd352aa1d295ae0e3356 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 5 Dec 2021 17:36:09 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst b/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst new file mode 100644 index 00000000000000..cf90ba8bc75bf9 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst @@ -0,0 +1 @@ +:c:func:`_PyErr_ChainStackItem` no longer normalized ``exc_info`` (including setting the traceback on the exception instance) because ``exc_info`` is always normalized. \ No newline at end of file From 0314b71ddea891a1e621d47c64b4e226fbf78c50 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Wed, 8 Dec 2021 11:50:00 +0000 Subject: [PATCH 3/3] Fix typo in news Co-authored-by: Oleg Iarygin --- .../Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst b/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst index cf90ba8bc75bf9..4e1f27a077b509 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2021-12-05-17-36-08.bpo-45711.3TmTSw.rst @@ -1 +1 @@ -:c:func:`_PyErr_ChainStackItem` no longer normalized ``exc_info`` (including setting the traceback on the exception instance) because ``exc_info`` is always normalized. \ No newline at end of file +:c:func:`_PyErr_ChainStackItem` no longer normalizes ``exc_info`` (including setting the traceback on the exception instance) because ``exc_info`` is always normalized. \ No newline at end of file