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:
@@ -192,7 +192,12 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
self.module = Module(self.parsers)
|
self.module = Module(self.parsers)
|
||||||
self.reset_caches()
|
self.reset_caches()
|
||||||
|
|
||||||
|
try:
|
||||||
self._parse(code)
|
self._parse(code)
|
||||||
|
except:
|
||||||
|
# FastParser is cached, be careful with exceptions
|
||||||
|
self.parsers[:] = []
|
||||||
|
raise
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_scope(self):
|
def user_scope(self):
|
||||||
@@ -221,7 +226,13 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
self.user_position = user_position
|
self.user_position = user_position
|
||||||
self.reset_caches()
|
self.reset_caches()
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
self._parse(code)
|
self._parse(code)
|
||||||
|
except:
|
||||||
|
# FastParser is cached, be careful with exceptions
|
||||||
|
self.parsers[:] = []
|
||||||
|
raise
|
||||||
|
|
||||||
def _scan_user_scope(self, sub_module):
|
def _scan_user_scope(self, sub_module):
|
||||||
""" Scan with self.user_position. """
|
""" Scan with self.user_position. """
|
||||||
|
|||||||
Reference in New Issue
Block a user