Kaydet (Commit) 23849906 authored tarafından Michael W. Hudson's avatar Michael W. Hudson

PyThreadState_Swap(NULL) didn't do what I thought it did. Fixes

[ 987287 ] Python 2.4a1, interpreter hanging on Keyboard Interrupt
üst b43dbcb4
...@@ -700,7 +700,7 @@ readline_until_enter_or_signal(char *prompt, int *signal) ...@@ -700,7 +700,7 @@ readline_until_enter_or_signal(char *prompt, int *signal)
int s; int s;
PyEval_RestoreThread(_PyOS_ReadlineTState); PyEval_RestoreThread(_PyOS_ReadlineTState);
s = PyErr_CheckSignals(); s = PyErr_CheckSignals();
PyThreadState_Swap(NULL); PyEval_SaveThread();
if (s < 0) { if (s < 0) {
rl_free_line_state(); rl_free_line_state();
rl_cleanup_after_signal(); rl_cleanup_after_signal();
......
...@@ -84,7 +84,7 @@ my_fgets(char *buf, int len, FILE *fp) ...@@ -84,7 +84,7 @@ my_fgets(char *buf, int len, FILE *fp)
int s; int s;
PyEval_RestoreThread(_PyOS_ReadlineTState); PyEval_RestoreThread(_PyOS_ReadlineTState);
s = PyErr_CheckSignals(); s = PyErr_CheckSignals();
PyThreadState_Swap(NULL); PyEval_SaveThread();
if (s < 0) { if (s < 0) {
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment