From ce207e6dbb4340013aec34f59ae45e5987506340 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 6 Jan 2014 21:20:38 +0100 Subject: [PATCH] goto shouldn't call names_to_types --- jedi/evaluate/__init__.py | 2 +- jedi/evaluate/finder.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index 08325f59..ddd53843 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -191,7 +191,7 @@ class Evaluator(object): f = finder.NameFinder(self, scope, name_str, position) scopes = f.scopes(search_global) if is_goto: - return f.names_to_types(f.filter_name(scopes, is_goto=is_goto)) + return f.filter_name(scopes, is_goto=is_goto) return f.find(scopes, resolve_decorator) @memoize_default(default=(), evaluator_is_first_arg=True) diff --git a/jedi/evaluate/finder.py b/jedi/evaluate/finder.py index 1d80b571..77d2c6b6 100644 --- a/jedi/evaluate/finder.py +++ b/jedi/evaluate/finder.py @@ -231,6 +231,10 @@ class NameFinder(object): if result: break + if not result and isinstance(self.scope, er.Instance): + # __getattr__ / __getattribute__ + result += self._check_getattr(self.scope) + debug.dbg('sfn filter "%s" in (%s-%s): %s@%s' % (self.name_str, self.scope, nscope, u(result), self.position)) return result @@ -248,10 +252,6 @@ class NameFinder(object): break flow_scope = flow_scope.parent - if not result and isinstance(self.scope, er.Instance): - # __getattr__ / __getattribute__ - result += self._check_getattr(self.scope) - return result def _check_getattr(self, inst):