Skip to content

Commit f39defe

Browse files
Fix an incorrect check in compiler_try_except(). (GH-9810)
(cherry picked from commit 53ebf4b) Co-authored-by: Zackery Spytz <[email protected]>
1 parent 69e6ad6 commit f39defe

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
@@ -2492,8 +2492,9 @@ compiler_try_except(struct compiler *c, stmt_ty s)
24922492

24932493
cleanup_end = compiler_new_block(c);
24942494
cleanup_body = compiler_new_block(c);
2495-
if (!(cleanup_end || cleanup_body))
2495+
if (cleanup_end == NULL || cleanup_body == NULL) {
24962496
return 0;
2497+
}
24972498

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

0 commit comments

Comments
 (0)