From 8d842dd596c05aeb5b3f8a7307dca5a98e5dc134 Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 2 Oct 2012 22:58:03 +0200 Subject: [PATCH] getattr on more complex objects - fixes #23 --- jedi/evaluate.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index b7f3b1db..e5d4a9e0 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -494,18 +494,11 @@ class Execution(Executable): 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):