Skip to content

Commit 4e56719

Browse files
committed
fixup! Search sys.path for PEP-561 compliant packages
1 parent 7b88327 commit 4e56719

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/modulefinder.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ def _find_module_non_stub_helper(self, components: List[str],
242242
dir_path = pkg_dir
243243
for index, component in enumerate(components):
244244
dir_path = os.path.join(dir_path, component)
245-
if self.fscache.isfile(os.path.join(dir_path, 'py.typed')):
245+
if not self.fscache.isdir(dir_path):
246+
break
247+
elif self.fscache.isfile(os.path.join(dir_path, 'py.typed')):
246248
return os.path.join(pkg_dir, *components[:-1]), index == 0
247249
elif not plausible_match and (self.fscache.isdir(dir_path)
248250
or self.fscache.isfile(dir_path + ".py")):

0 commit comments

Comments
 (0)