summaryrefslogtreecommitdiff
path: root/astroid/helpers.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-10-18 10:50:35 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2019-10-18 10:51:44 +0200
commit476d1b84025e6a980cc11fb2287426241c59977e (patch)
tree1cc36695d3aa1d4f7c1f2d32c7e5b3caf3320ed5 /astroid/helpers.py
parentaf802b16fb61cf3b07002c3def04c9c6f3c21c80 (diff)
downloadastroid-git-476d1b84025e6a980cc11fb2287426241c59977e.tar.gz
Pass an inference context to `metaclass()` when inferring an object type
This should prevent a bunch of recursion errors happening in pylint. Also refactor the inference of `IfExp` nodes to use separate contexts for each potential branch. Close PyCQA/pylint#3152 Close PyCQA/pylint#3159
Diffstat (limited to 'astroid/helpers.py')
-rw-r--r--astroid/helpers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index 749a2389..be133b38 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -52,7 +52,7 @@ def _object_type(node, context=None):
for inferred in node.infer(context=context):
if isinstance(inferred, scoped_nodes.ClassDef):
if inferred.newstyle:
- metaclass = inferred.metaclass()
+ metaclass = inferred.metaclass(context=context)
if metaclass:
yield metaclass
continue