Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move the GIL release to after setting an error
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
  • Loading branch information
tonybaloney and ericsnowcurrently authored Nov 22, 2023
commit 6e9e66d49d7516e0bfaac2762ed8d94d13248de0
2 changes: 1 addition & 1 deletion Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,10 @@ on_startup_hook(void)
PyGILState_STATE gilstate = PyGILState_Ensure();
PyObject* mod = PyState_FindModule(&readlinemodule);
if (mod == NULL) {
PyGILState_Release(gilstate);
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_ImportError, "readline import initialization failure during startup hook");
Comment thread
tonybaloney marked this conversation as resolved.
Outdated
}
PyGILState_Release(gilstate);
return -1;
} else {
Py_INCREF(mod);
Comment thread
tonybaloney marked this conversation as resolved.
Outdated
Expand Down