Extended the code of the flakes checker plug-in to really ignore the * imports warnings, if configured that way.

Mon, 05 Dec 2016 18:38:11 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 05 Dec 2016 18:38:11 +0100
changeset 5363
cbe61c2f9772
parent 5362
e9b8797923da
child 5364
d94357a96871

Extended the code of the flakes checker plug-in to really ignore the * imports warnings, if configured that way.

Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sun Dec 04 18:40:41 2016 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Mon Dec 05 18:38:11 2016 +0100
@@ -16,7 +16,7 @@
 
 try:
     from pyflakes.checker import Checker
-    from pyflakes.messages import ImportStarUsed
+    from pyflakes.messages import ImportStarUsed, ImportStarUsage
 except ImportError:
     pass
 
@@ -275,8 +275,10 @@
         warnings = Checker(module, filename, withDoctest=True)
         warnings.messages.sort(key=lambda a: a.lineno)
         for warning in warnings.messages:
-            if ignoreStarImportWarnings and \
-                    isinstance(warning, ImportStarUsed):
+            if ignoreStarImportWarnings and (
+                isinstance(warning, ImportStarUsed) or
+                isinstance(warning, ImportStarUsage)
+            ):
                 continue
             
             _fn, lineno, col, message, msg_args = warning.getMessageData()

eric ide

mercurial