summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorAnthony Shaw <anthony.p.shaw@gmail.com>2023-11-28 01:58:53 (GMT)
committerGitHub <noreply@github.com>2023-11-28 01:58:53 (GMT)
commit154f099e611cea74daa755c77df3b8003861cc76 (patch)
treea46ac82eab33ba99842613f95886faea1a01f846 /Python/Python-ast.c
parent2e632fa07d13a58be62f59be4e656ad58b378f9b (diff)
downloadcpython-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