mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Remove a statement that didn't make sense
This commit is contained in:
@@ -133,7 +133,7 @@ class AbstractTreeName(AbstractNameDefinition):
|
|||||||
|
|
||||||
def get_defining_qualified_value(self):
|
def get_defining_qualified_value(self):
|
||||||
if self.is_import():
|
if self.is_import():
|
||||||
raise 1
|
raise NotImplementedError("Shouldn't really happen, please report")
|
||||||
elif self.parent_context:
|
elif self.parent_context:
|
||||||
return self.parent_context.get_value() # Might be None
|
return self.parent_context.get_value() # Might be None
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -54,3 +54,11 @@ def test_goto_on_file(Script):
|
|||||||
script = Script(path=d1.module_path, _project=project)
|
script = Script(path=d1.module_path, _project=project)
|
||||||
d2, = script.goto(line=d1.line, column=d1.column + 4)
|
d2, = script.goto(line=d1.line, column=d1.column + 4)
|
||||||
assert d2.name == 'Bar'
|
assert d2.name == 'Bar'
|
||||||
|
|
||||||
|
|
||||||
|
def test_goto_import(Script):
|
||||||
|
code = 'from abc import ABC; ABC'
|
||||||
|
d, = Script(code).goto(only_stubs=True)
|
||||||
|
assert d.is_stub()
|
||||||
|
d, = Script(code).goto()
|
||||||
|
assert not d.is_stub()
|
||||||
|
|||||||
Reference in New Issue
Block a user