From 0c678bc88f47913fe2e6ffa7103d4b09934e7439 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Tue, 19 Apr 2022 10:36:47 -0700 Subject: [PATCH] fixup! Search sys.path for PEP-561 compliant packages --- mypy/modulefinder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py index 6bcad4eafb742..8d0dcc730f5d6 100644 --- a/mypy/modulefinder.py +++ b/mypy/modulefinder.py @@ -247,6 +247,8 @@ def _find_module_non_stub_helper(self, components: List[str], elif not plausible_match and (self.fscache.isdir(dir_path) or self.fscache.isfile(dir_path + ".py")): plausible_match = True + if not self.fscache.isdir(dir_path): + break if is_legacy_bundled_package(components[0], self.python_major_ver): if (len(components) == 1 or (self.find_module(components[0]) is