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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 05 Dec 2016 18:38:11 +0100
branch
maintenance
changeset 5368
3ef8f39609a0
parent 5357
a420982ca6c8
child 5369
69705ef2a0af

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

Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sat Dec 03 12:51:16 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