1
0
forked from VimPlug/jedi

always operate on class in super and not on an instance. that's the proper way.

This commit is contained in:
Dave Halter
2014-07-30 11:34:27 +02:00
parent e81749bbe1
commit 196afaacbf
2 changed files with 3 additions and 1 deletions

View File

@@ -176,7 +176,7 @@ class Instance(use_metaclass(CachedMetaClass, Executable)):
def __getattr__(self, name):
if name not in ['start_pos', 'end_pos', 'name', 'get_imports',
'doc', 'raw_doc', 'asserts', 'py_bases']:
'doc', 'raw_doc', 'asserts']:
raise AttributeError("Instance %s: Don't touch this (%s)!"
% (self, name))
return getattr(self.base, name)

View File

@@ -100,6 +100,8 @@ def builtins_super(evaluator, obj, params):
if isinstance(cls, wanted):
if isinstance(cls, pr.Class):
cls = er.Class(evaluator, cls)
elif isinstance(cls, er.Instance):
cls = cls.base
su = cls.py_bases()
if su:
return evaluator.execute(su[0])