mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Fix various bugs.
This commit is contained in:
@@ -60,7 +60,7 @@ def _paths_from_assignment(evaluator, statement):
|
|||||||
for exp_list, operator in statement.assignment_details:
|
for exp_list, operator in statement.assignment_details:
|
||||||
if len(exp_list) != 1 or not isinstance(exp_list[0], pr.Call):
|
if len(exp_list) != 1 or not isinstance(exp_list[0], pr.Call):
|
||||||
continue
|
continue
|
||||||
if unicode(exp_list[0].name) != 'sys.path':
|
if exp_list[0].names() != ['sys', 'path']:
|
||||||
continue
|
continue
|
||||||
# TODO at this point we ignore all ways what could be assigned to
|
# TODO at this point we ignore all ways what could be assigned to
|
||||||
# sys.path or an execution of it. Here we could do way more
|
# sys.path or an execution of it. Here we could do way more
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class TestCallAndName():
|
|||||||
def test_call_type(self):
|
def test_call_type(self):
|
||||||
call = self.get_call('hello')
|
call = self.get_call('hello')
|
||||||
assert isinstance(call, pr.Call)
|
assert isinstance(call, pr.Call)
|
||||||
assert type(call.name) == pr.Name
|
assert type(call.name) == pr.NamePart
|
||||||
|
|
||||||
def test_literal_type(self):
|
def test_literal_type(self):
|
||||||
literal = self.get_call('1.0')
|
literal = self.get_call('1.0')
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ asdfasdf""" + "h"
|
|||||||
def test_tokenizer_with_string_literal_backslash():
|
def test_tokenizer_with_string_literal_backslash():
|
||||||
import jedi
|
import jedi
|
||||||
c = jedi.Script("statement = u'foo\\\n'; statement").goto_definitions()
|
c = jedi.Script("statement = u'foo\\\n'; statement").goto_definitions()
|
||||||
assert c[0]._name.parent.parent.obj == 'foo'
|
assert c[0]._name.parent.obj == 'foo'
|
||||||
|
|||||||
Reference in New Issue
Block a user