Skip to content

[3.12] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522)#109777

Merged
Yhg1s merged 1 commit intopython:3.12from
miss-islington:backport-62c7015-3.12
Oct 2, 2023
Merged

[3.12] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522)#109777
Yhg1s merged 1 commit intopython:3.12from
miss-islington:backport-62c7015-3.12

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 23, 2023

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 62c7015)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…pythonGH-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.
(cherry picked from commit 62c7015)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants