mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Better debugging
This commit is contained in:
@@ -328,7 +328,7 @@ class FunctionExecutionContext(TreeContext):
|
||||
else:
|
||||
if evaluator.environment.version_info < (3, 5):
|
||||
return NO_CONTEXTS
|
||||
async_classes = evaluator.typing_module .py__getattribute__('Coroutine')
|
||||
async_classes = evaluator.typing_module.py__getattribute__('Coroutine')
|
||||
return_contexts = self.get_return_values()
|
||||
return ContextSet(
|
||||
AnnotatedSubClass(
|
||||
|
||||
@@ -571,9 +571,10 @@ class AbstractAnnotatedClass(ClassContext):
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s%s>' % (
|
||||
return '<%s: %s@%s%s>' % (
|
||||
self.__class__.__name__,
|
||||
self.name.string_name,
|
||||
self.name.tree_name.start_pos,
|
||||
list(self.get_given_types()),
|
||||
)
|
||||
|
||||
|
||||
@@ -408,7 +408,6 @@ def import_module(evaluator, import_names, parent_module_context, sys_path):
|
||||
|
||||
module_name = '.'.join(import_names)
|
||||
if parent_module_context is None:
|
||||
debug.dbg('global search_module %s', import_names[-1])
|
||||
# Override the sys.path. It works only good that way.
|
||||
# Injecting the path directly into `find_module` did not work.
|
||||
code, module_path, is_pkg = evaluator.compiled_subprocess.get_module_info(
|
||||
@@ -427,7 +426,6 @@ def import_module(evaluator, import_names, parent_module_context, sys_path):
|
||||
raise JediImportError(import_names)
|
||||
else:
|
||||
paths = method()
|
||||
debug.dbg('search_module %s in paths %s', module_name, paths)
|
||||
for path in paths:
|
||||
# At the moment we are only using one path. So this is
|
||||
# not important to be correct.
|
||||
@@ -450,6 +448,10 @@ def import_module(evaluator, import_names, parent_module_context, sys_path):
|
||||
safe_module_name=True,
|
||||
)
|
||||
|
||||
if parent_module_context is None:
|
||||
debug.dbg('global search_module %s: %s', import_names[-1], module)
|
||||
else:
|
||||
debug.dbg('search_module %s in paths %s: %s', module_name, paths, module)
|
||||
return ContextSet([module])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user