mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Python: Disregard packages when looking for cyclic imports.
This commit is contained in:
@@ -21,7 +21,8 @@ predicate circular_import(ModuleValue m1, ModuleValue m2) {
|
||||
ModuleValue stmt_imports(ImportingStmt s) {
|
||||
exists(string name | result.importedAs(name) and not name = "__main__" |
|
||||
name = s.getAnImportedModuleName() and
|
||||
s.getASubExpression().pointsTo(result)
|
||||
s.getASubExpression().pointsTo(result) and
|
||||
not result.isPackage()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user