summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-05-05 13:03:43 +0300
committercpopa <devnull@localhost>2014-05-05 13:03:43 +0300
commit7f5869347f70a4af11587a8975e262e9c813386b (patch)
tree25f35b4b7067e4e4de806e1cd4e45d4990c37184 /checkers/variables.py
parent0babd7e4bdc86b1c06791d6bc933267eda0d6f26 (diff)
downloadpylint-7f5869347f70a4af11587a8975e262e9c813386b.tar.gz
If the metaclass was infered properly, skip the undefined-variable check.
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index f923721..ebe520a 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -748,11 +748,9 @@ class VariablesChecker3k(VariablesChecker):
module_locals.get(name, module_imports.get(name))
)
- if found is None:
+ if found is None and not metaclass:
name = None
- if metaclass:
- name = metaclass.name
- elif isinstance(klass._metaclass, astroid.Name):
+ if isinstance(klass._metaclass, astroid.Name):
name = klass._metaclass.name
elif isinstance(klass._metaclass, astroid.Getattr):
name = klass._metaclass.as_string()