mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Make a method public
This commit is contained in:
@@ -87,8 +87,8 @@ def _try_stub_to_python_names(names, prefer_stub_to_compiled=False):
|
|||||||
def _load_stub_module(module):
|
def _load_stub_module(module):
|
||||||
if module.is_stub():
|
if module.is_stub():
|
||||||
return module
|
return module
|
||||||
from jedi.inference.gradual.typeshed import _try_to_load_stub_cached
|
from jedi.inference.gradual.typeshed import try_to_load_stub_cached
|
||||||
return _try_to_load_stub_cached(
|
return try_to_load_stub_cached(
|
||||||
module.inference_state,
|
module.inference_state,
|
||||||
import_names=module.string_names,
|
import_names=module.string_names,
|
||||||
python_value_set=ValueSet([module]),
|
python_value_set=ValueSet([module]),
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ def import_module_decorator(func):
|
|||||||
if not prefer_stubs:
|
if not prefer_stubs:
|
||||||
return python_value_set
|
return python_value_set
|
||||||
|
|
||||||
stub = _try_to_load_stub_cached(inference_state, import_names, python_value_set,
|
stub = try_to_load_stub_cached(inference_state, import_names, python_value_set,
|
||||||
parent_module_value, sys_path)
|
parent_module_value, sys_path)
|
||||||
if stub is not None:
|
if stub is not None:
|
||||||
return ValueSet([stub])
|
return ValueSet([stub])
|
||||||
return python_value_set
|
return python_value_set
|
||||||
@@ -129,7 +129,7 @@ def import_module_decorator(func):
|
|||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
def _try_to_load_stub_cached(inference_state, import_names, *args, **kwargs):
|
def try_to_load_stub_cached(inference_state, import_names, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
return inference_state.stub_module_cache[import_names]
|
return inference_state.stub_module_cache[import_names]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -153,7 +153,7 @@ def _try_to_load_stub(inference_state, import_names, python_value_set,
|
|||||||
"""
|
"""
|
||||||
if parent_module_value is None and len(import_names) > 1:
|
if parent_module_value is None and len(import_names) > 1:
|
||||||
try:
|
try:
|
||||||
parent_module_value = _try_to_load_stub_cached(
|
parent_module_value = try_to_load_stub_cached(
|
||||||
inference_state, import_names[:-1], NO_VALUES,
|
inference_state, import_names[:-1], NO_VALUES,
|
||||||
parent_module_value=None, sys_path=sys_path)
|
parent_module_value=None, sys_path=sys_path)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
Reference in New Issue
Block a user