From 2e949b43bb3ce45e4d519c9c6bffd68bb6980eb4 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 20 Aug 2014 11:31:11 +0200 Subject: [PATCH] Ignore FunctionExecutions in old style isinstance checks for now, because it collides with new style isinstance checks. --- jedi/evaluate/finder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jedi/evaluate/finder.py b/jedi/evaluate/finder.py index 7a139046..d97ee5bc 100644 --- a/jedi/evaluate/finder.py +++ b/jedi/evaluate/finder.py @@ -206,10 +206,11 @@ class NameFinder(object): evaluator = self._evaluator # Add isinstance and other if/assert knowledge. - flow_scope = self.scope if isinstance(self.name_str, pr.NamePart): flow_scope = self.name_str.parent.parent - while flow_scope: + # Ignore FunctionExecution parents for now. + until = flow_scope.get_parent_until(er.FunctionExecution) + while flow_scope and not isinstance(until, er.FunctionExecution): # TODO check if result is in scope -> no evaluation necessary n = check_flow_information(evaluator, flow_scope, self.name_str, self.position)