diff --git a/jedi/parsing.py b/jedi/parsing.py index 96525d6f..43453d92 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -140,6 +140,7 @@ class Parser(object): append((tok, self.start_pos)) first_pos = self.start_pos while True: + end_pos = self.end_pos token_type, tok = self.next() if tok != '.': break @@ -148,8 +149,7 @@ class Parser(object): break append((tok, self.start_pos)) - n = pr.Name(self.module, names, first_pos, self.end_pos) if names \ - else None + n = pr.Name(self.module, names, first_pos, end_pos) if names else None return n, token_type, tok def _parse_import_list(self): diff --git a/test/test_parsing.py b/test/test_parsing.py index 6d67499b..5dc49aac 100644 --- a/test/test_parsing.py +++ b/test/test_parsing.py @@ -26,8 +26,8 @@ class TestCallAndName(): call = self.get_call('1.0\n') assert call.name == 1.0 - assert call.name.start_pos == call.start_pos == (1, 0) - assert call.name.end_pos == call.end_pos == (1, 3) + assert call.start_pos == (1, 0) + assert call.end_pos == (1, 3) def test_call_type(self): call = self.get_call('hello')