Skip to content

Commit

Permalink
fix regression from #15347
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 25, 2024
1 parent ac79825 commit b773887
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mypy/modulefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
return ancestor

if approved_stub_package_exists(id):
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
if len(components) == 1 or (
self.find_module(components[0])
is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
):
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
elif found_possible_third_party_missing_type_hints:
return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
else:
Expand Down

0 comments on commit b773887

Please sign in to comment.