UtilitiesPython2/Py2SyntaxChecker.py

changeset 1308
2b602a1521e7
parent 945
8cd4d08fa9f6
child 1465
3b459b88fcd4
diff -r 9f7a056dbcc6 -r 2b602a1521e7 UtilitiesPython2/Py2SyntaxChecker.py
--- a/UtilitiesPython2/Py2SyntaxChecker.py	Fri Sep 09 09:33:19 2011 +0200
+++ b/UtilitiesPython2/Py2SyntaxChecker.py	Fri Sep 09 11:54:20 2011 +0200
@@ -12,7 +12,7 @@
 import re
 import traceback
 
-from Tools import readEncodedFile, normalizeCode
+from Tools import readEncodedFile, normalizeCode, extractLineFlags
 
 from py2flakes.checker import Checker
 from py2flakes.messages import ImportStarUsed
@@ -117,8 +117,7 @@
                 continue
             
             _fn, lineno, message = warning.getMessageData()
-            if not lines[lineno - 1].strip()\
-               .endswith("__IGNORE_WARNING__"):
+            if "__IGNORE_WARNING__" not in extractLineFlags(lines[lineno - 1].strip()):
                 strings.extend(["FLAKES_WARNING", _fn, lineno, message])
     except SyntaxError as err:
         if err.text.strip():

eric ide

mercurial