]> granicus.if.org Git - python/commitdiff
bpo-35798: Fix duplicate SyntaxWarning: "is" with a literal. (GH-11639)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 16 Feb 2019 06:29:46 +0000 (08:29 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Feb 2019 06:29:46 +0000 (08:29 +0200)
Python/compile.c

index 7565d3c480725b43b3f88204473e16428376e1de..18877d96da10bb636aa06abf6f1e13d8e107fc31 100644 (file)
@@ -2404,11 +2404,11 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond)
         return 1;
     }
     case Compare_kind: {
-        if (!check_compare(c, e)) {
-            return 0;
-        }
         Py_ssize_t i, n = asdl_seq_LEN(e->v.Compare.ops) - 1;
         if (n > 0) {
+            if (!check_compare(c, e)) {
+                return 0;
+            }
             basicblock *cleanup = compiler_new_block(c);
             if (cleanup == NULL)
                 return 0;