]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId...
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 26 Oct 2020 06:43:39 +0000 (08:43 +0200)
committerGitHub <noreply@github.com>
Mon, 26 Oct 2020 06:43:39 +0000 (08:43 +0200)
commitfb5db7ec58624cab0797b4050735be865d380823
tree7b0421bb759ba01f0d735296738472faa4ce11b8
parent96a9eed2457c05af6953890d89463704c9d99c57
bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId. (GH-22648)

These functions are considered not safe because they suppress all internal errors
and can return wrong result.  PyDict_GetItemString and _PyDict_GetItemId can
also silence current exception in rare cases.

Remove no longer used _PyDict_GetItemId.
Add _PyDict_ContainsId and rename _PyDict_Contains into
_PyDict_Contains_KnownHash.
17 files changed:
Include/cpython/dictobject.h
Modules/_decimal/_decimal.c
Modules/_threadmodule.c
Modules/_zoneinfo.c
Modules/signalmodule.c
Modules/socketmodule.c
Objects/dictobject.c
Objects/moduleobject.c
Objects/setobject.c
Objects/structseq.c
Objects/typeobject.c
Python/ceval.c
Python/compile.c
Python/pylifecycle.c
Python/pythonrun.c
Python/symtable.c
Python/sysmodule.c