mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Move a part of stub lookups
This commit is contained in:
@@ -163,7 +163,12 @@ def _try_to_load_stub(evaluator, actual_context_set, parent_module_context, sys_
|
|||||||
if m is not None:
|
if m is not None:
|
||||||
return m
|
return m
|
||||||
|
|
||||||
# 3. Try to load pyi file somewhere if actual_context_set was not defined.
|
# 3. finally try to load typeshed
|
||||||
|
m = _load_from_typeshed(evaluator, actual_context_set, parent_module_context, import_names)
|
||||||
|
if m is not None:
|
||||||
|
return m
|
||||||
|
|
||||||
|
# 4. Try to load pyi file somewhere if actual_context_set was not defined.
|
||||||
if not actual_context_set:
|
if not actual_context_set:
|
||||||
if parent_module_context is not None:
|
if parent_module_context is not None:
|
||||||
# TODO this attribute doesn't always exist
|
# TODO this attribute doesn't always exist
|
||||||
@@ -185,11 +190,6 @@ def _try_to_load_stub(evaluator, actual_context_set, parent_module_context, sys_
|
|||||||
if m is not None:
|
if m is not None:
|
||||||
return m
|
return m
|
||||||
|
|
||||||
# 4. finally try to load typeshed
|
|
||||||
m = _load_from_typeshed(evaluator, actual_context_set, parent_module_context, import_names)
|
|
||||||
if m is not None:
|
|
||||||
return m
|
|
||||||
|
|
||||||
evaluator.stub_module_cache[import_names] = None
|
evaluator.stub_module_cache[import_names] = None
|
||||||
# If no stub is found, that's fine, the calling function has to deal with
|
# If no stub is found, that's fine, the calling function has to deal with
|
||||||
# it.
|
# it.
|
||||||
|
|||||||
Reference in New Issue
Block a user