Skip to content

Commit b773887

Browse files
committed
fix regression from #15347
1 parent ac79825 commit b773887

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypy/modulefinder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,11 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
553553
return ancestor
554554

555555
if approved_stub_package_exists(id):
556-
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
556+
if len(components) == 1 or (
557+
self.find_module(components[0])
558+
is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
559+
):
560+
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
557561
elif found_possible_third_party_missing_type_hints:
558562
return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
559563
else:

0 commit comments

Comments
 (0)