Files
codeql/python/ql/test/library-tests/variables/scopes/lookup.ql
2018-11-19 15:15:54 +00:00

17 lines
335 B
Plaintext

import python
from NameNode n, string l
where
n.isLoad() and (
n.isGlobal() and l = "global"
or
n.isLocal() and l = "local"
or
n.isNonLocal() and l = "non-local"
or
not n.isGlobal() and not n.isLocal() and
not n.isNonLocal() and
l = "none"
)
select n.getLocation().getStartLine(), n.toString(), l