Skip to content

Commit

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

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

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

0 comments on commit fbc8ff0

Please sign in to comment.