diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2009-03-10 18:30:18 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2009-03-10 18:30:18 +0100 |
commit | da5280f4130a90b36fdf64dfc3dfa58f9b1df54d (patch) | |
tree | ef7b7b55c5f7be2b1e84b57ab6dd2e50a32ed74e /checkers/classes.py | |
parent | 7200bd9d9a59d7944ae489a8ba735f35607e2714 (diff) | |
download | pylint-da5280f4130a90b36fdf64dfc3dfa58f9b1df54d.tar.gz |
little corrections
Diffstat (limited to 'checkers/classes.py')
-rw-r--r-- | checkers/classes.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/checkers/classes.py b/checkers/classes.py index 200f5aa..b8b7afc 100644 --- a/checkers/classes.py +++ b/checkers/classes.py @@ -350,15 +350,16 @@ instance attributes.'} # don't care about functions with unknown argument (builtins) if node.args.args is None: return - first = node.argnames()[0] - self._first_attrs.append(first) + first_arg = node.args.args and node.argnames()[0] + self._first_attrs.append(first_arg) + first = self._first_attrs[-1] # static method if node.type == 'staticmethod': - if first in ('self', 'cls', 'mcs'): + if first_arg in ('self', 'cls', 'mcs'): self.add_message('W0211', args=first, node=node) self._first_attrs[-1] = None # class / regular method with no args - elif not first: + elif not node.args.args: self.add_message('E0211', node=node) # metaclass method elif metaclass: |