]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix an incorrect check in compiler_try_except(). (GH-9810)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 12 Oct 2018 07:19:38 +0000 (00:19 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Oct 2018 07:19:38 +0000 (00:19 -0700)
(cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Python/compile.c

index c1df7e8d98245bd902fdba59efa4450904ec3076..fac1c5bfdca3bb9323ed8c3425f13a18da96f848 100644 (file)
@@ -2492,8 +2492,9 @@ compiler_try_except(struct compiler *c, stmt_ty s)
 
             cleanup_end = compiler_new_block(c);
             cleanup_body = compiler_new_block(c);
-            if (!(cleanup_end || cleanup_body))
+            if (cleanup_end == NULL || cleanup_body == NULL) {
                 return 0;
+            }
 
             compiler_nameop(c, handler->v.ExceptHandler.name, Store);
             ADDOP(c, POP_TOP);