Skip to content

Commit

Permalink
getattr on more complex objects - fixes #23
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Oct 2, 2012
1 parent 4d80297 commit 8d842dd
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions jedi/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,18 +494,11 @@ def get_return_types(self, evaluate_generator=False):
for obj in objects:
if not isinstance(obj, (Instance, Class)):
debug.warning('getattr called without instance')
return []
continue

for name in names:
key = name.var_args.get_only_subelement()
try:
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 []
stmts += follow_path(iter([key]), obj)
return stmts

if self.base.isinstance(Class):
Expand Down

0 comments on commit 8d842dd

Please sign in to comment.