Skip to content

Commit 53ebf4b

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
Fix an incorrect check in compiler_try_except(). (GH-9810)
1 parent fc439d2 commit 53ebf4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2738,8 +2738,9 @@ compiler_try_except(struct compiler *c, stmt_ty s)
27382738

27392739
cleanup_end = compiler_new_block(c);
27402740
cleanup_body = compiler_new_block(c);
2741-
if (!(cleanup_end || cleanup_body))
2741+
if (cleanup_end == NULL || cleanup_body == NULL) {
27422742
return 0;
2743+
}
27432744

27442745
compiler_nameop(c, handler->v.ExceptHandler.name, Store);
27452746
ADDOP(c, POP_TOP);

0 commit comments

Comments
 (0)