Skip to content

Commit 76f7750

Browse files
committed
oops, i forgot to include the optimisation
1 parent ad5982b commit 76f7750

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mypy/modulefinder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,8 @@ def _find_module_non_stub_helper(
331331
# If this is not a directory then we can't traverse further into it
332332
if not self.fscache.isdir(dir_path):
333333
break
334-
for i in range(len(components), 0, -1):
335-
if approved_stub_package_exists(".".join(components[:i])):
336-
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
334+
if approved_stub_package_exists(".".join(components)):
335+
return ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED
337336
if plausible_match:
338337
return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
339338
else:

0 commit comments

Comments
 (0)