Skip to content

Commit 088a631

Browse files
committed
Remove the all_are_submodules handling
1 parent c02f9bc commit 088a631

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

mypy/build.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -658,23 +658,15 @@ def correct_rel_imp(imp: Union[ImportFrom, ImportAll]) -> str:
658658
elif isinstance(imp, ImportFrom):
659659
cur_id = correct_rel_imp(imp)
660660
pos = len(res)
661-
all_are_submodules = True
662661
# Also add any imported names that are submodules.
663662
pri = import_priority(imp, PRI_MED)
664663
for name, __ in imp.names:
665664
sub_id = cur_id + '.' + name
666665
if self.is_module(sub_id):
667666
res.append((pri, sub_id, imp.line))
668-
else:
669-
all_are_submodules = False
670-
# If all imported names are submodules, don't add
671-
# cur_id as a dependency. Otherwise (i.e., if at
672-
# least one imported name isn't a submodule)
673-
# cur_id is also a dependency, and we should
674-
# insert it *before* any submodules.
675-
if not all_are_submodules:
676-
pri = import_priority(imp, PRI_HIGH)
677-
res.insert(pos, ((pri, cur_id, imp.line)))
667+
668+
pri = import_priority(imp, PRI_HIGH)
669+
res.insert(pos, ((pri, cur_id, imp.line)))
678670
elif isinstance(imp, ImportAll):
679671
pri = import_priority(imp, PRI_HIGH)
680672
res.append((pri, correct_rel_imp(imp), imp.line))

0 commit comments

Comments
 (0)