Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eaedc7c

Browse files
committed
eval_code2(), set_exc_info(): Call PyErr_NormalizeException() the
former rather than the latter, since PyErr_NormalizeException takes PyObject** and I didn't want to change the interface for set_exc_info (but I did want the changes propagated to eval_code2!).
1 parent c1f0882 commit eaedc7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,8 @@ eval_code2(co, globals, locals,
17951795
Python main loop. Don't do
17961796
this for 'finally'. */
17971797
if (b->b_type == SETUP_EXCEPT) {
1798+
PyErr_NormalizeException(
1799+
&exc, &val, &tb);
17981800
set_exc_info(tstate,
17991801
exc, val, tb);
18001802
}
@@ -1875,8 +1877,6 @@ set_exc_info(tstate, type, value, tb)
18751877
PyFrameObject *frame;
18761878
PyObject *tmp_type, *tmp_value, *tmp_tb;
18771879

1878-
PyErr_NormalizeException(&type, &value, &tb);
1879-
18801880
frame = tstate->frame;
18811881
if (frame->f_exc_type == NULL) {
18821882
/* This frame didn't catch an exception before */

0 commit comments

Comments
 (0)