From 4839f3d80e411e80978d6003b53085044d8e8a64 Mon Sep 17 00:00:00 2001 From: David Halter Date: Sat, 27 Apr 2013 21:25:42 +0430 Subject: [PATCH] fix a scope problem with the new fast parser --- jedi/fast_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jedi/fast_parser.py b/jedi/fast_parser.py index 7a447003..d9df708e 100644 --- a/jedi/fast_parser.py +++ b/jedi/fast_parser.py @@ -140,6 +140,7 @@ class ParserNode(object): for key, c in self._contents.items(): setattr(scope, key, c) scope.is_generator = self._is_generator + self.parser.user_scope = None for c in self.children: c.reset_contents() @@ -180,9 +181,9 @@ class ParserNode(object): for d in i.decorators: d.parent = scope.use_as_parent content += items - if str(parser.module.name) == 'ordering': - #print scope.subscopes - pass + if isinstance(parser.user_scope, pr.SubModule) \ + and parser.start_pos <= parser.user_position < parser.end_pos: + parser.user_scope = scope scope.is_generator |= parser.module.is_generator def add_node(self, node):