1
0
forked from VimPlug/jedi

stopiteration works in strange ways in the parser in py2, fixes #70, affects probably davidhalter/jedi-vim#68

This commit is contained in:
David Halter
2013-01-12 12:15:32 +01:00
parent dd58afe8b2
commit 7b150630f0
2 changed files with 4 additions and 2 deletions

View File

@@ -1276,7 +1276,9 @@ class PyFuzzyParser(object):
self.top_module = top_module or self.module
try:
self._parse()
except common.MultiLevelStopIteration:
except (common.MultiLevelStopIteration, StopIteration):
# StopIteration needs to be added as well, because python 2 has a
# strange way of handling StopIterations.
# sometimes StopIteration isn't catched. Just ignore it.
pass

View File

@@ -207,7 +207,7 @@ class TestRegression(TestBase):
assert check(self.get_in_function_call(s, (4, 31)), 'compile', 0)
# jedi-vim #70
s = """def foo("""
assert check(self.get_in_function_call(s), None, 0)
assert self.get_in_function_call(s) is None
def test_add_dynamic_mods(self):
api.settings.additional_dynamic_modules = ['dynamic.py']