PyThreadState_Swap(NULL) didn't do what I thought it did. Fixes
[ 987287 ] Python 2.4a1, interpreter hanging on Keyboard Interrupt
This commit is contained in:
parent
b43dbcb4e8
commit
2384990603
|
@ -700,7 +700,7 @@ readline_until_enter_or_signal(char *prompt, int *signal)
|
|||
int s;
|
||||
PyEval_RestoreThread(_PyOS_ReadlineTState);
|
||||
s = PyErr_CheckSignals();
|
||||
PyThreadState_Swap(NULL);
|
||||
PyEval_SaveThread();
|
||||
if (s < 0) {
|
||||
rl_free_line_state();
|
||||
rl_cleanup_after_signal();
|
||||
|
|
|
@ -84,7 +84,7 @@ my_fgets(char *buf, int len, FILE *fp)
|
|||
int s;
|
||||
PyEval_RestoreThread(_PyOS_ReadlineTState);
|
||||
s = PyErr_CheckSignals();
|
||||
PyThreadState_Swap(NULL);
|
||||
PyEval_SaveThread();
|
||||
if (s < 0) {
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue