]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-99537: Use Py_CLEAR() function in C code (#99686)
authorVictor Stinner <vstinner@python.org>
Tue, 22 Nov 2022 14:22:55 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Nov 2022 14:22:55 +0000 (15:22 +0100)
commit9a91182d4a87e4511dad20ad101e3eab0e1c5088
tree5b0faaafd4db48a1c57507670457b2192f6299a7
parent7e3f09cad9b783d8968aa79ff6a8ee57beb8b83e
gh-99537: Use Py_CLEAR() function in C code (#99686)

Replace "Py_XDECREF(var); var = NULL;" with "Py_CLEAR(var);".

Don't replace "Py_DECREF(var); var = NULL;" with "Py_CLEAR(var);". It
would add an useless "if (var)" test in code path where var cannot be
NULL.
Modules/_xxsubinterpretersmodule.c
Modules/_zoneinfo.c