diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-09-23 06:39:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 06:39:24 (GMT) |
commit | 62c7015e89cbdedb5218d4fedd45f971885f67a8 (patch) | |
tree | a6c8a17353fbaf884de9d370f176f8f087bab26f /Misc | |
parent | b8d1744e7ba87a4057350fdfd788b5621095fc59 (diff) | |
download | cpython-62c7015e89cbdedb5218d4fedd45f971885f67a8.zip cpython-62c7015e89cbdedb5218d4fedd45f971885f67a8.tar.gz cpython-62c7015e89cbdedb5218d4fedd45f971885f67a8.tar.bz2 |
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/C API/2023-09-17-21-47-31.gh-issue-109521.JDF6i9.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2023-09-17-21-47-31.gh-issue-109521.JDF6i9.rst b/Misc/NEWS.d/next/C API/2023-09-17-21-47-31.gh-issue-109521.JDF6i9.rst new file mode 100644 index 0000000..338650c --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-09-17-21-47-31.gh-issue-109521.JDF6i9.rst @@ -0,0 +1,5 @@ +:c:func:`PyImport_GetImporter` now sets RuntimeError if it fails to get +:data:`sys.path_hooks` or :data:`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. |