Python: Don't import module as module_attr

For `from <pkg> import <attr>` we would use to treat the `<pkg>`
(ImportExpr) as a definition of the name `<attr>`.

Since this removes bad import-flow, and nothing broke, I'm guessing this
was never intentional.
This commit is contained in:
Rasmus Wriedt Larsen
2023-02-22 14:52:35 +01:00
parent 6ba39d5fb3
commit 4df7dfbff6
3 changed files with 2 additions and 15 deletions

View File

@@ -95,7 +95,7 @@ module ImportResolution {
)
or
exists(Alias a |
defn.asExpr() = [a.getValue(), a.getValue().(ImportMember).getModule()] and
defn.asExpr() = a.getValue() and
a.getAsname().(Name).getId() = name and
defn.getScope() = m
)