diff options
author | Anthony Shaw <anthony.p.shaw@gmail.com> | 2023-11-28 01:58:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 01:58:53 (GMT) |
commit | 154f099e611cea74daa755c77df3b8003861cc76 (patch) | |
tree | a46ac82eab33ba99842613f95886faea1a01f846 /Python/Python-ast.c | |
parent | 2e632fa07d13a58be62f59be4e656ad58b378f9b (diff) | |
download | cpython-154f099e611cea74daa755c77df3b8003861cc76.zip cpython-154f099e611cea74daa755c77df3b8003861cc76.tar.gz cpython-154f099e611cea74daa755c77df3b8003861cc76.tar.bz2 |
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.
Diffstat (limited to 'Python/Python-ast.c')
0 files changed, 0 insertions, 0 deletions