mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
fix another keyword problem
This commit is contained in:
@@ -659,7 +659,8 @@ class Parser(object):
|
|||||||
continue
|
continue
|
||||||
elif tok == 'assert':
|
elif tok == 'assert':
|
||||||
stmt, tok = self._parse_statement()
|
stmt, tok = self._parse_statement()
|
||||||
stmt.parent = use_as_parent_scope
|
if stmt is not None:
|
||||||
|
stmt.parent = use_as_parent_scope
|
||||||
self._scope.asserts.append(stmt)
|
self._scope.asserts.append(stmt)
|
||||||
# default
|
# default
|
||||||
elif token_type in [tokenize.NAME, tokenize.STRING,
|
elif token_type in [tokenize.NAME, tokenize.STRING,
|
||||||
|
|||||||
@@ -326,6 +326,9 @@ class TestRegression(TestBase):
|
|||||||
assert len(defs) == 0
|
assert len(defs) == 0
|
||||||
completions = self.completions("import", (1,1))
|
completions = self.completions("import", (1,1))
|
||||||
assert len(completions) == 0
|
assert len(completions) == 0
|
||||||
|
with common.ignored(jedi.NotFoundError): # TODO shouldn't throw that.
|
||||||
|
defs = self.goto_definitions("assert")
|
||||||
|
assert len(defs) == 1
|
||||||
|
|
||||||
def test_goto_following_on_imports(self):
|
def test_goto_following_on_imports(self):
|
||||||
s = "import multiprocessing.dummy; multiprocessing.dummy"
|
s = "import multiprocessing.dummy; multiprocessing.dummy"
|
||||||
|
|||||||
Reference in New Issue
Block a user