Skip to content

Commit e018d5d

Browse files
committed
workaround regression for now
1 parent ac79825 commit e018d5d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,10 @@ 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+
# TODO: testMissingSubmoduleOfInstalledStubPackageIgnored was regressed in
3150+
# https://github.com/python/mypy/pull/15347 but didn't cause failures because we don't have a
3151+
# package path in this unit test
3152+
[case testMissingSubmoduleOfInstalledStubPackageIgnored-xfail]
31503153
# flags: --ignore-missing-imports
31513154
import bleach.xyz
31523155
from bleach.abc import fgh

0 commit comments

Comments
 (0)