We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e4af96 commit 09b9102Copy full SHA for 09b9102
Python/compile.c
@@ -1633,8 +1633,7 @@ static void
1633
compiler_exit_scope(struct compiler *c)
1634
{
1635
// Don't call PySequence_DelItem() with an exception raised
1636
- PyObject *exc_type, *exc_val, *exc_tb;
1637
- PyErr_Fetch(&exc_type, &exc_val, &exc_tb);
+ PyObject *exc = PyErr_GetRaisedException();
1638
1639
c->c_nestlevel--;
1640
compiler_unit_free(c->u);
@@ -1655,7 +1654,7 @@ compiler_exit_scope(struct compiler *c)
1655
1654
c->u = NULL;
1656
}
1657
1658
- PyErr_Restore(exc_type, exc_val, exc_tb);
+ PyErr_SetRaisedException(exc);
1659
1660
1661
/* Search if variable annotations are present statically in a block. */
0 commit comments