Python: Ignore from foo import * when foo is absent.

This commit is contained in:
Taus Brock-Nannestad
2020-08-13 10:50:28 +02:00
parent dc5c0f8e7a
commit a1a1218f95
2 changed files with 1 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ predicate all_defined(ModuleValue exporter) {
}
from ImportStar imp, ModuleValue exporter
where import_star(imp, exporter) and not all_defined(exporter)
where import_star(imp, exporter) and not all_defined(exporter) and not exporter.isAbsent()
select imp,
"Import pollutes the enclosing namespace, as the imported module $@ does not define '__all__'.",
exporter, exporter.getName()