MCPcopy Index your code
hub / github.com/python/mypy / skipping_module

Function skipping_module

mypy/build.py:3984–3996  ·  view source on GitHub ↗

Produce an error for an import ignored due to --follow_imports=error

(
    manager: BuildManager, line: int, caller_state: State | None, id: str, path: str
)

Source from the content-addressed store, hash-verified

3982
3983
3984def skipping_module(
3985 manager: BuildManager, line: int, caller_state: State | None, id: str, path: str
3986) -> None:
3987 """Produce an error for an import ignored due to --follow_imports=error"""
3988 assert caller_state, (id, path)
3989 save_import_context = manager.errors.import_context()
3990 manager.errors.set_import_context(caller_state.import_context)
3991 manager.errors.set_file(caller_state.xpath, caller_state.id, manager.options)
3992 manager.error(line, f'Import of "{id}" ignored')
3993 manager.note(
3994 line, "(Using --follow-imports=error, module not passed on command line)", only_once=True
3995 )
3996 manager.errors.set_import_context(save_import_context)
3997
3998
3999def skipping_ancestor(manager: BuildManager, id: str, path: str, ancestor_for: State) -> None:

Callers 1

find_module_and_diagnoseFunction · 0.85

Calls 5

import_contextMethod · 0.80
set_import_contextMethod · 0.80
set_fileMethod · 0.80
errorMethod · 0.45
noteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…