Fixed an issue in the naming style checker caused by AST changes in Python 3.4.

Sat, 21 Jun 2014 18:11:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 21 Jun 2014 18:11:38 +0200
changeset 3646
cfbb47b6d885
parent 3644
a2c88b9b1d16
child 3647
fef91a1eb27b

Fixed an issue in the naming style checker caused by AST changes in Python 3.4.
(grafted from 79b58173f80360032ecc81e272df30354b9b2234)

Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py file | annotate | diff | comparison | revisions
diff -r a2c88b9b1d16 -r cfbb47b6d885 Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py
--- a/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Fri Jun 20 16:05:45 2014 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Sat Jun 21 18:11:38 2014 +0200
@@ -321,12 +321,20 @@
             (integer, integer, string)
         """
         if node.args.kwarg is not None:
-            if not self.LowercaseRegex.match(node.args.kwarg):
+            if sys.version_info >= (3, 4):
+                kwarg = node.args.kwarg.arg
+            else:
+                kwarg = node.args.kwarg
+            if not self.LowercaseRegex.match(kwarg):
                 yield self.__error(node, "N803")
                 return
         
         if node.args.vararg is not None:
-            if not self.LowercaseRegex.match(node.args.vararg):
+            if sys.version_info >= (3, 4):
+                vararg = node.args.vararg.arg
+            else:
+                vararg = node.args.vararg
+            if not self.LowercaseRegex.match(vararg):
                 yield self.__error(node, "N803")
                 return
         

eric ide

mercurial