Python: In py/import-own-module handle from foo import *

This commit is contained in:
Rasmus Wriedt Larsen
2020-02-11 11:42:40 +01:00
parent 5cc2efef8e
commit 1f762841ec
3 changed files with 4 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
import python
predicate modules_imports_itself(Import i, ModuleValue m) {
predicate modules_imports_itself(ImportingStmt i, ModuleValue m) {
i.getEnclosingModule() = m.getScope() and
m = max(string s, ModuleValue m_ |
s = i.getAnImportedModuleName() and
@@ -22,6 +22,6 @@ predicate modules_imports_itself(Import i, ModuleValue m) {
)
}
from Import i, ModuleValue m
from ImportingStmt i, ModuleValue m
where modules_imports_itself(i, m)
select i, "The module '" + m.getName() + "' imports itself."