When we are working with CompiledObjects and instances there should never be a case where class values are returned.

This commit is contained in:
Dave Halter
2016-05-15 23:06:07 +02:00
parent cc331d62e0
commit 50f6bb0299

View File

@@ -155,7 +155,12 @@ class CompiledObject(Base):
search_global shouldn't change the fact that there's one dict, this way
there's only one `object`.
"""
return [LazyNamesDict(self._evaluator, self._cls(), is_instance)]
cls = self._cls()
if cls != self:
# If we are working with a class, the names_dict should not include
# class names.
is_instance = True
return [LazyNamesDict(self._evaluator, cls, is_instance)]
def get_subscope_by_name(self, name):
if name in dir(self._cls().obj):