mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Merge branch 'master' into typeshed
This commit is contained in:
@@ -99,7 +99,7 @@ def check_sys_path_modifications(module_context):
|
|||||||
def get_sys_path_powers(names):
|
def get_sys_path_powers(names):
|
||||||
for name in names:
|
for name in names:
|
||||||
power = name.parent.parent
|
power = name.parent.parent
|
||||||
if power.type in ('power', 'atom_expr'):
|
if power is not None and power.type in ('power', 'atom_expr'):
|
||||||
c = power.children
|
c = power.children
|
||||||
if c[0].type == 'name' and c[0].value == 'sys' \
|
if c[0].type == 'name' and c[0].value == 'sys' \
|
||||||
and c[1].type == 'trailer':
|
and c[1].type == 'trailer':
|
||||||
|
|||||||
@@ -356,3 +356,9 @@ def test_name_not_findable():
|
|||||||
setattr(X, 'NOT_FINDABLE', X.hidden)
|
setattr(X, 'NOT_FINDABLE', X.hidden)
|
||||||
|
|
||||||
assert jedi.Interpreter("X.NOT_FINDA", [locals()]).completions()
|
assert jedi.Interpreter("X.NOT_FINDA", [locals()]).completions()
|
||||||
|
|
||||||
|
|
||||||
|
def test_sys_path_docstring(): # Was an issue in #1298
|
||||||
|
import jedi
|
||||||
|
s = jedi.Interpreter("from sys import path\npath", line=2, column=4, namespaces=[locals()])
|
||||||
|
s.completions()[0].docstring()
|
||||||
|
|||||||
Reference in New Issue
Block a user