forked from VimPlug/jedi
getattr on more complex objects - fixes #23
This commit is contained in:
@@ -494,18 +494,11 @@ class Execution(Executable):
|
|||||||
for obj in objects:
|
for obj in objects:
|
||||||
if not isinstance(obj, (Instance, Class)):
|
if not isinstance(obj, (Instance, Class)):
|
||||||
debug.warning('getattr called without instance')
|
debug.warning('getattr called without instance')
|
||||||
return []
|
continue
|
||||||
|
|
||||||
for name in names:
|
for name in names:
|
||||||
key = name.var_args.get_only_subelement()
|
key = name.var_args.get_only_subelement()
|
||||||
try:
|
stmts += follow_path(iter([key]), obj)
|
||||||
stmts.append(obj.get_subscope_by_name(key))
|
|
||||||
except KeyError:
|
|
||||||
debug.warning('called getattr() without string')
|
|
||||||
#if not (isinstance(name, Instance) \
|
|
||||||
#and name.var_args:
|
|
||||||
#debug.warning('getattr called without instance')
|
|
||||||
#return []
|
|
||||||
return stmts
|
return stmts
|
||||||
|
|
||||||
if self.base.isinstance(Class):
|
if self.base.isinstance(Class):
|
||||||
|
|||||||
Reference in New Issue
Block a user