Files
codeql/python/ql/test/library-tests/PointsTo/new/NameSpace.ql
2025-11-26 12:30:31 +00:00

20 lines
430 B
Plaintext

import python
import Util
private import LegacyPointsTo
from Scope s, string name, Object val
where
name != "__name__" and
(
exists(ModuleObject m |
m.getModule() = s and
m.attributeRefersTo(name, val, _)
)
or
exists(ClassObject cls |
cls.getPyClass() = s and
cls.declaredAttribute(name) = val
)
)
select locate(s.getLocation(), "abcdghijklopqrs"), s.toString(), name, repr(val)