Files
codeql/python/ql/test/2/library-tests/modules/usage/ModuleUsage.ql
Rasmus Wriedt Larsen f9e9ae91f7 Python: Move tests that would change under Python 3.12 to lang specific directory
This moves the tests to Python 2, next we copy them to Python 3.
2023-11-15 11:42:38 +01:00

17 lines
384 B
Plaintext

import python
from ModuleValue mv, string usage
where
// builtin module has different name in Python 2 and 3
not mv = Module::builtinModule() and
(
mv.isUsedAsModule() and usage = "isUsedAsModule"
or
mv.isUsedAsScript() and usage = "isUsedAsScript"
or
not mv.isUsedAsModule() and
not mv.isUsedAsScript() and
usage = "<UNKNOWN>"
)
select mv, usage