bpo-45711: Remove unnecessary normalization of exc_info (GH-29922) · python/cpython@2109f78 (original) (raw)

Original file line number Diff line number Diff line change
@@ -647,26 +647,6 @@ _PyErr_ChainStackItem(_PyErr_StackItem *exc_info)
647 647 PyObject *typ, *val, *tb;
648 648 _PyErr_Fetch(tstate, &typ, &val, &tb);
649 649
650 -PyObject *typ2, *val2, *tb2;
651 -typ2 = exc_info->exc_type;
652 -val2 = exc_info->exc_value;
653 -tb2 = exc_info->exc_traceback;
654 -#ifdef Py_DEBUG
655 -PyObject *typ2_before = typ2;
656 -PyObject *val2_before = val2;
657 -PyObject *tb2_before = tb2;
658 -#endif
659 -_PyErr_NormalizeException(tstate, &typ2, &val2, &tb2);
660 -#ifdef Py_DEBUG
661 -/* exc_info should already be normalized */
662 -assert(typ2 == typ2_before);
663 -assert(val2 == val2_before);
664 -assert(tb2 == tb2_before);
665 -#endif
666 -if (tb2 != NULL) {
667 -PyException_SetTraceback(val2, tb2);
668 - }
669 -
670 650 /* _PyErr_SetObject sets the context from PyThreadState. */
671 651 _PyErr_SetObject(tstate, typ, val);
672 652 Py_DECREF(typ); // since _PyErr_Occurred was true