Skip to content

Commit 09b9102

Browse files
committed
Python/compile.c
1 parent 1e4af96 commit 09b9102

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/compile.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,8 +1633,7 @@ static void
16331633
compiler_exit_scope(struct compiler *c)
16341634
{
16351635
// 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);
1636+
PyObject *exc = PyErr_GetRaisedException();
16381637

16391638
c->c_nestlevel--;
16401639
compiler_unit_free(c->u);
@@ -1655,7 +1654,7 @@ compiler_exit_scope(struct compiler *c)
16551654
c->u = NULL;
16561655
}
16571656

1658-
PyErr_Restore(exc_type, exc_val, exc_tb);
1657+
PyErr_SetRaisedException(exc);
16591658
}
16601659

16611660
/* Search if variable annotations are present statically in a block. */

0 commit comments

Comments
 (0)