eric6/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py

changeset 7637
c878e8255972
parent 7360
9190402e4505
child 7639
422fd05e9c91
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Mon Jun 22 17:55:06 2020 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Tue Jun 23 17:24:18 2020 +0200
@@ -188,27 +188,9 @@
         @param node AST node to extract arguments names from
         @return list of argument names (list of string)
         """
-        if sys.version_info[0] >= 3:
-            posArgs = [arg.arg for arg in node.args.args]
-            kwOnly = [arg.arg for arg in node.args.kwonlyargs]
-            return posArgs + kwOnly
-        else:
-            def unpackArgs(args):
-                """
-                Local helper function to unpack function argument names.
-                
-                @param args list of AST node arguments
-                @return list of argument names (list of string)
-                """
-                ret = []
-                for arg in args:
-                    if isinstance(arg, ast.Tuple):
-                        ret.extend(unpackArgs(arg.elts))
-                    else:
-                        ret.append(arg.id)
-                return ret
-           
-            return unpackArgs(node.args.args)
+        posArgs = [arg.arg for arg in node.args.args]
+        kwOnly = [arg.arg for arg in node.args.kwonlyargs]
+        return posArgs + kwOnly
     
     def __error(self, node, code):
         """

eric ide

mercurial