]> granicus.if.org Git - python/commitdiff
Fix an incorrect check in compiler_try_except(). (GH-9810)
authorZackery Spytz <zspytz@gmail.com>
Fri, 12 Oct 2018 05:54:03 +0000 (23:54 -0600)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 12 Oct 2018 05:54:03 +0000 (08:54 +0300)
Python/compile.c

index 096b762f36bb0df4a3e1fc698e7c4ad8d5464762..78b7baf3235f8fbed9915e17c57980240bd37aaa 100644 (file)
@@ -2738,8 +2738,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);