Skip to content

Commit affdedd

Browse files
authored
Python: Add missing builtins to API::builtin
We were missing out on `None`, `True`, and `False` as these do not appear as actual attributes of the `builtins` module in Python 3 (because they are elevated to the status of keywords there) The simple solution, then, is to just always include them directly.
1 parent ab58cb3 commit affdedd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/ql/src/semmle/python/ApiGraphs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ module API {
363363
n.isGlobal() and
364364
n.isLoad() and
365365
name = n.getId() and
366-
name = any(Builtins::Builtin b).getName()
366+
name in [any(Builtins::Builtin b).getName(), "None", "True", "False"]
367367
)
368368
}
369369

0 commit comments

Comments
 (0)