Python: Fix unwanted module type tracking

This commit is contained in:
Taus Brock-Nannestad
2020-10-13 22:47:57 +02:00
parent 76e5b59dab
commit 7d86b53b71
2 changed files with 1 additions and 8 deletions

View File

@@ -70,7 +70,7 @@ Node importModule(string name) {
// Because named imports are modelled as `AttrRead`s, the statement `from foo import bar as baz`
// is interpreted as if it was an assignment `baz = foo.bar`, which means `baz` gets tracked as a
// reference to `foo.bar`, as desired.
result.asCfgNode().getNode() = any(ImportExpr i | i.getAnImportedModuleName() = name)
result.asCfgNode().getNode() = any(ImportExpr i | i.getName() = name)
}
/**