]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522...
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 7 Oct 2023 13:05:13 +0000 (16:05 +0300)
committerGitHub <noreply@github.com>
Sat, 7 Oct 2023 13:05:13 +0000 (16:05 +0300)
commit6a33529cf0bcfe9001af58e45ea8feab4daed265
tree054d9860d99141dbf7c02c0dcbeceac194e412fe
parent3d5aa7ec6129330c10e76435b627ff1df2cb08f7
[3.11] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522) (GH-109781)

PyImport_GetImporter() now sets RuntimeError if it fails to get sys.path_hooks
or sys.path_importer_cache or they are not list and dict correspondingly.

Previously it could return NULL without setting error in obscure cases,
crash or raise SystemError if these attributes have wrong type.
(cherry picked from commit 62c7015e89cbdedb5218d4fedd45f971885f67a8)
Misc/NEWS.d/next/C API/2023-09-17-21-47-31.gh-issue-109521.JDF6i9.rst [new file with mode: 0644]
Python/import.c