From 21b49a17ffd49834e2b76f03000255b48cba9707 Mon Sep 17 00:00:00 2001 From: David Halter Date: Sat, 15 Dec 2012 23:17:37 +0100 Subject: [PATCH] fix last problems with fast_parser --- jedi/fast_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jedi/fast_parser.py b/jedi/fast_parser.py index 476e1523..e443ffa4 100644 --- a/jedi/fast_parser.py +++ b/jedi/fast_parser.py @@ -151,8 +151,10 @@ class FastParser(use_metaclass(CachedFastParser)): if self._user_scope is None: for p in self.parsers: if p.user_scope: + if self._user_scope is not None and not \ + isinstance(self._user_scope, parsing.SubModule): + continue self._user_scope = p.user_scope - break if isinstance(self._user_scope, parsing.SubModule): self._user_scope = self.module @@ -164,6 +166,7 @@ class FastParser(use_metaclass(CachedFastParser)): for p in self.parsers: if p.user_stmt: self._user_stmt = p.user_stmt + break return self._user_stmt def update(self, code, user_position=None):