summaryrefslogtreecommitdiff
path: root/builder.py
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2010-09-21 16:08:32 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2010-09-21 16:08:32 +0200
commit326f84469c40d5f6ca656036f5212bba4ce09c34 (patch)
treeb98522ed2827c838e552a3c3dd73fdbe77eaf504 /builder.py
parentca49e5aecc1bf0f556527dc80b176cf0385a8a7d (diff)
downloadastroid-git-326f84469c40d5f6ca656036f5212bba4ce09c34.tar.gz
fix #45959: AttributeError: 'NoneType' object has no attribute 'frame'
due to handling of __class__ when importing from living object (because of missing source code or C-compiled object) --HG-- branch : stable
Diffstat (limited to 'builder.py')
-rw-r--r--builder.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/builder.py b/builder.py
index 9acda4ad..f4563ec4 100644
--- a/builder.py
+++ b/builder.py
@@ -190,6 +190,8 @@ class ASTNGBuilder:
class_node = object_build_class(node, member, name)
# recursion
self.object_build(class_node, member)
+ if name == '__class__' and class_node.parent is None:
+ class_node.parent = self._done[self._module]
elif ismethoddescriptor(member):
assert isinstance(member, object)
object_build_methoddescriptor(node, member, name)