Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py

changeset 5588
6ba512d9f46a
parent 5585
dab20c39f08c
child 5589
ad8f37c6a306
diff -r ea526b78ee6c -r 6ba512d9f46a Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py
--- a/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Tue Mar 07 18:53:18 2017 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Tue Mar 07 19:46:57 2017 +0100
@@ -312,10 +312,10 @@
         """
         Private method to check the __future__ imports.
         """
-        expectedImports = set(
-            [i.strip()
-             for i in self.__args.get("FutureChecker", "").split(",")
-             if bool(i.strip())])
+        expectedImports = {
+            i.strip()
+            for i in self.__args.get("FutureChecker", "").split(",")
+            if bool(i.strip())}
         if len(expectedImports) == 0:
             # nothing to check for; disabling the check
             return
@@ -327,7 +327,7 @@
         for node in ast.walk(self.__tree):
             if (isinstance(node, ast.ImportFrom) and
                     node.module == '__future__'):
-                imports |= set(name.name for name in node.names)
+                imports |= {name.name for name in node.names}
             elif isinstance(node, ast.Expr):
                 if not isinstance(node.value, ast.Str):
                     hasCode = True
@@ -416,7 +416,7 @@
                     else:
                         names.add(fieldMatch.group(1))
                 
-                keywords = set(keyword.arg for keyword in call.keywords)
+                keywords = {keyword.arg for keyword in call.keywords}
                 numArgs = len(call.args)
                 if strArgs:
                     numArgs -= 1

eric ide

mercurial