SIGN IN SIGN UP

gh-112292 : Catch import error conditions with readline hooks (gh-112313)

Prevents a segmentation fault in registered hooks for the readline library, but only when the readline module is loaded inside an isolated sub interpreter.  The module is single-phase init so loading it fails, but not until the module init function has already run, where the readline hooks get registered.

The readlinestate_global macro was error-prone to PyImport_FindModule returning NULL and crashing in about 18 places.  I could reproduce 1 easily, but this PR replaces the macro with a function and adds error conditions to the other functions.
A
Anthony Shaw committed
154f099e611cea74daa755c77df3b8003861cc76
Parent: 2e632fa
Committed by GitHub <noreply@github.com> on 11/28/2023, 1:58:53 AM