Files
codeql/python/ql/test/3/extractor-tests/lazy-imports/test.ql

12 lines
325 B
Plaintext

import python
string lazy(Stmt s) {
if s.(Import).isLazy() or s.(ImportStar).isLazy() then result = "lazy" else result = "normal"
}
from Stmt s
where
s.getLocation().getFile().getShortName() = "test.py" and
(s instanceof Import or s instanceof ImportStar)
select s.getLocation().getStartLine(), s.toString(), lazy(s)