Restore all_are_submodules
import logic as workaround for #4498
#5016
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logic in build to determine what imported modules are depended on
used to elide dependencies to m in
from m import a, b, c
if all ofa, b, c were submodules. This was removed in #4910 because it seemed
like it ought not be necessary (and that semantically there was
a dependency), and early versions of #4910 depended removing it.
The addition of this dependency, though, can cause cycles that
wouldn't be there otherwise, which can cause #4498 (invalid type when
using aliases in import cycles) to trip when it otherwise wouldn't.
We've seen this once in a bug report and once internally, so restore
the
all_are_submodules
logic in avoid triggering #4498 in thesecases.
Fixes #5015