Skip to content

Commit

Permalink
move below
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 25, 2024
1 parent fd68921 commit ac79825
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions mypy/modulefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
third_party_inline_dirs: PackageDirs = []
third_party_stubs_dirs: PackageDirs = []
found_possible_third_party_missing_type_hints = False
need_installed_stubs = False
# Third-party stub/typed packages
candidate_package_dirs = {
package_dir[0]
Expand Down Expand Up @@ -455,9 +454,6 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
third_party_inline_dirs.append(non_stub_match)
self._update_ns_ancestors(components, non_stub_match)

if approved_stub_package_exists(id):
need_installed_stubs = True

if self.options and self.options.use_builtins_fixtures:
# Everything should be in fixtures.
third_party_inline_dirs.clear()
Expand Down Expand Up @@ -556,7 +552,7 @@ def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:
if ancestor is not None:
return ancestor

if need_installed_stubs:
if approved_stub_package_exists(id):
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
elif found_possible_third_party_missing_type_hints:
return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
Expand Down

0 comments on commit ac79825

Please sign in to comment.