[Python-checkins] bpo-35798: Fix duplicate SyntaxWarning: "is" with a literal. (GH-11639)

Serhiy Storchaka webhook-mailer at python.org
Sat Feb 16 01:29:49 EST 2019


https://github.com/python/cpython/commit/4583525835baf8fc7bd49a60725d1e8c49ef92b3
commit: 4583525835baf8fc7bd49a60725d1e8c49ef92b3
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-02-16T08:29:46+02:00
summary:

bpo-35798: Fix duplicate SyntaxWarning: "is" with a literal. (GH-11639)

files:
M Python/compile.c

diff --git a/Python/compile.c b/Python/compile.c
index 7565d3c48072..18877d96da10 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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;



More information about the Python-checkins mailing list