Skip to content

Commit 778dbec

Browse files
committed
workaround regression for now
1 parent ac79825 commit 778dbec

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

mypy/modulefinder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,9 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
554554

555555
if approved_stub_package_exists(id):
556556
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
557-
elif found_possible_third_party_missing_type_hints:
557+
if found_possible_third_party_missing_type_hints:
558558
return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
559-
else:
560-
return ModuleNotFoundReason.NOT_FOUND
559+
return ModuleNotFoundReason.NOT_FOUND
561560

562561
def find_modules_recursive(self, module: str) -> list[BuildSource]:
563562
module_path = self.find_module(module, fast_path=True)

test-data/unit/check-modules.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3146,8 +3146,13 @@ main:1: note: (or run "mypy --install-types" to install all missing stub package
31463146
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
31473147
main:2: error: Library stubs not installed for "bleach.abc"
31483148

3149-
[case testMissingSubmoduleOfInstalledStubPackageIgnored]
3149+
[case testMissingSubmoduleOfInstalledStubPackageIgnored-xfail]
31503150
# flags: --ignore-missing-imports
3151+
3152+
# TODO: testMissingSubmoduleOfInstalledStubPackageIgnored was regressed in
3153+
# https://github.com/python/mypy/pull/15347 but didn't cause failures because we don't have a
3154+
# package path in this unit test
3155+
31513156
import bleach.xyz
31523157
from bleach.abc import fgh
31533158
[file bleach/__init__.pyi]

0 commit comments

Comments
 (0)