]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fix use of 'is' operator for comparison
authorRaul Tambre <raul@tambre.ee>
Thu, 2 May 2019 17:23:56 +0000 (20:23 +0300)
committerAdrian <adrian@planetcoding.net>
Mon, 6 May 2019 16:11:06 +0000 (18:11 +0200)
The 'is' operator is not meant to be used for comparisons. It currently working is an implementation detail of CPython.
CPython 3.8 has added a SyntaxWarning for this.

ext/inlinegettext.py

index cf4ed5e4418cd6059f69164fbfc6899366dfecd7..6ff10dafb6a810feb952312f8c3f553d7943661d 100644 (file)
@@ -32,7 +32,7 @@ class InlineGettext(Extension):
         paren_stack = 0
 
         for token in stream:
-            if token.type is not 'data':
+            if token.type != 'data':
                 yield token
                 continue