Skip to content

Commit

Permalink
workaround regression for now
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 25, 2024
1 parent ac79825 commit 778dbec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mypy/modulefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,9 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:

if approved_stub_package_exists(id):
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
elif found_possible_third_party_missing_type_hints:
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
7 changes: 6 additions & 1 deletion test-data/unit/check-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -3146,8 +3146,13 @@ main:1: note: (or run "mypy --install-types" to install all missing stub package
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
main:2: error: Library stubs not installed for "bleach.abc"

[case testMissingSubmoduleOfInstalledStubPackageIgnored]
[case testMissingSubmoduleOfInstalledStubPackageIgnored-xfail]
# flags: --ignore-missing-imports

# TODO: testMissingSubmoduleOfInstalledStubPackageIgnored was regressed in
# https://github.com/python/mypy/pull/15347 but didn't cause failures because we don't have a
# package path in this unit test

import bleach.xyz
from bleach.abc import fgh
[file bleach/__init__.pyi]
Expand Down

0 comments on commit 778dbec

Please sign in to comment.