summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index e7ba88d..515c450 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -42,7 +42,7 @@ def overridden_method(klass, name):
# dictionary. This may happen with astng built from living objects.
return None
# check its a method
- if getattr(meth_node, 'argnames', None) is not None:
+ if getattr(meth_node.args, 'args', None) is not None:
return meth_node
return None
@@ -230,6 +230,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
return
authorized_rgx = self.config.dummy_variables_rgx
overridden = marker = []
+ args = node.args.args
for name, stmts in not_consumed.iteritems():
# ignore some special names specified by user configuration
if authorized_rgx.match(name):
@@ -240,16 +241,15 @@ builtins. Remember that you should avoid to define new builtins when possible.'
if isinstance(stmt, astng.Global):
continue
# care about functions with unknown argument (builtins)
- if node.argnames is not None and name in node.argnames:
+ if args and name in args:
if is_method:
# don't warn for the first argument of a (non static) method
- if node.type != 'staticmethod' and \
- node.argnames and name == node.argnames[0]:
+ if node.type != 'staticmethod' and name == args[0]:
continue
# don't warn for argument of an overridden method
if overridden is marker:
overridden = overridden_method(klass, node.name)
- if overridden is not None and name in overridden.argnames:
+ if overridden is not None and name in overridden.args.args:
continue
# don't check callback arguments
if node.name.startswith('cb_') or \