Skip to content

Commit

Permalink
Match note error codes to import error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Aug 31, 2023
1 parent 5783af4 commit f46bf76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,7 @@ def module_not_found(
for note in notes:
if "{stub_dist}" in note:
note = note.format(stub_dist=stub_distribution_name(module))
errors.report(line, 0, note, severity="note", only_once=True, code=codes.IMPORT)
errors.report(line, 0, note, severity="note", only_once=True, code=code)
if reason is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED:
manager.missing_stub_packages.add(stub_distribution_name(module))
errors.set_import_context(save_import_context)
Expand Down
1 change: 1 addition & 0 deletions test-data/unit/pep561.test
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ a.bf(False)
b.bf(False)
a.bf(1)
b.bf(1)
import typedpkg_ns.whatever as c # type: ignore[import-untyped]
[out]
testNamespacePkgWStubs.py:4: error: Skipping analyzing "typedpkg_ns.b.bbb": module is installed, but missing library stubs or py.typed marker
testNamespacePkgWStubs.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Expand Down

0 comments on commit f46bf76

Please sign in to comment.