Skip to content

Commit 72927d0

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 1c2cb51 commit 72927d0

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

26712671
cleanup_end = compiler_new_block(c);
26722672
cleanup_body = compiler_new_block(c);
2673-
if (!(cleanup_end || cleanup_body))
2673+
if (cleanup_end == NULL || cleanup_body == NULL) {
26742674
return 0;
2675+
}
26752676

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

0 commit comments

Comments
 (0)