1
0
forked from VimPlug/jedi

do some sort of error handling in fast_parser, because if fast_parser cracks down, cache might be corrupted

This commit is contained in:
David Halter
2013-08-16 11:12:35 +04:30
parent f76ec55786
commit ae6e997098

View File

@@ -192,7 +192,12 @@ class FastParser(use_metaclass(CachedFastParser)):
self.module = Module(self.parsers)
self.reset_caches()
self._parse(code)
try:
self._parse(code)
except:
# FastParser is cached, be careful with exceptions
self.parsers[:] = []
raise
@property
def user_scope(self):
@@ -221,7 +226,13 @@ class FastParser(use_metaclass(CachedFastParser)):
self.user_position = user_position
self.reset_caches()
self._parse(code)
try:
self._parse(code)
except:
# FastParser is cached, be careful with exceptions
self.parsers[:] = []
raise
def _scan_user_scope(self, sub_module):
""" Scan with self.user_position. """