Skip to content

Commit 927333d

Browse files
committed
.
1 parent 07cfe7b commit 927333d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

mypy/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
from mypy.renaming import LimitedVariableRenameVisitor, VariableRenameVisitor
9292
from mypy.stats import dump_type_stats
9393
from mypy.stubinfo import (
94-
is_legacy_bundled_package,
9594
legacy_bundled_packages,
9695
non_bundled_packages,
9796
stub_distribution_name,
@@ -2672,7 +2671,10 @@ def find_module_and_diagnose(
26722671
# negatives. (Unless there are stubs but they are incomplete.)
26732672
global_ignore_missing_imports = manager.options.ignore_missing_imports
26742673
if (
2675-
any(".".join(id_components[:i]) in legacy_bundled_packages for i in range(len(id_components), 0, -1))
2674+
any(
2675+
".".join(id_components[:i]) in legacy_bundled_packages
2676+
for i in range(len(id_components), 0, -1)
2677+
)
26762678
and global_ignore_missing_imports
26772679
and not options.ignore_missing_imports_per_module
26782680
and result is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED

test-data/unit/check-modules.test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3138,9 +3138,11 @@ import bleach.xyz
31383138
from bleach.abc import fgh
31393139
[file bleach/__init__.pyi]
31403140
[out]
3141-
main:1: error: Cannot find implementation or library stub for module named "bleach.xyz"
3141+
main:1: error: Library stubs not installed for "bleach.xyz"
3142+
main:1: note: Hint: "python3 -m pip install types-bleach"
3143+
main:1: note: (or run "mypy --install-types" to install all missing stub packages)
31423144
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
3143-
main:2: error: Cannot find implementation or library stub for module named "bleach.abc"
3145+
main:2: error: Library stubs not installed for "bleach.abc"
31443146

31453147
[case testMissingSubmoduleOfInstalledStubPackageIgnored]
31463148
# flags: --ignore-missing-imports

0 commit comments

Comments
 (0)