summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorAndrew Haigh <hello@nelf.in>2021-04-22 18:14:41 +1000
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-05-02 09:40:38 +0200
commit7ae5f4b828be222fdcf706eb3c9e546ffd284d0f (patch)
tree54745794d850599f5652a828f6f53195320bbd1a /astroid
parentf36055fab5bc970a9e65c73fcf090efd716586d8 (diff)
downloadastroid-git-7ae5f4b828be222fdcf706eb3c9e546ffd284d0f.tar.gz
Fix scope lookup of "type" for type inference brain
Diffstat (limited to 'astroid')
-rw-r--r--astroid/brain/brain_type.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/brain/brain_type.py b/astroid/brain/brain_type.py
index 3a69cd5f..c6fc382b 100644
--- a/astroid/brain/brain_type.py
+++ b/astroid/brain/brain_type.py
@@ -47,7 +47,8 @@ def infer_type_sub(node, context=None):
:return: the inferred node
:rtype: nodes.NodeNG
"""
- if "type" in node.scope().locals:
+ node_scope, _ = node.scope().lookup("type")
+ if node_scope.qname() != "builtins":
raise UseInferenceDefault()
class_src = """
class type: