]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 23 Sep 2023 06:39:24 +0000 (09:39 +0300)
committerGitHub <noreply@github.com>
Sat, 23 Sep 2023 06:39:24 +0000 (09:39 +0300)
commit62c7015e89cbdedb5218d4fedd45f971885f67a8
treea6c8a17353fbaf884de9d370f176f8f087bab26f
parentb8d1744e7ba87a4057350fdfd788b5621095fc59
gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522)

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.
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