[3.12] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522) (#109777)
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. (cherry picked from commit 62c7015e89cbdedb5218d4fedd45f971885f67a8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
M
Miss Islington (bot) committed
5e6e99646e46d485e018429f6000661609e4f1b5
Parent: 6a6bea3
Committed by GitHub <noreply@github.com>
on 10/2/2023, 3:22:40 PM