Skip to content

Commit a8be9d0

Browse files
committed
Add extra check to filter out non-modules
This commit adds an (ad-hoc) check to the indirect dependencies patcher to filter out computed dependencies that are not, in fact, actually modules. Ideally, this ad-hoc check shouldn't be necessary but there are enough weird edge cases that it seems like a useful thing to have to prevent unexpected behavior.
1 parent 6fbd6c2 commit a8be9d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mypy/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,8 @@ def _patch_indirect_dependencies(self, module_refs: Set[str]) -> None:
14361436
extra = encountered - valid
14371437

14381438
for dep in sorted(extra):
1439+
if dep not in self.manager.modules:
1440+
continue
14391441
if dep not in self.suppressed and dep not in self.manager.missing_modules:
14401442
self.dependencies.append(dep)
14411443
self.priorities[dep] = PRI_INDIRECT

0 commit comments

Comments
 (0)