From 238499060351da61665c1e623c5f59c6d0ef3354 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Thu, 8 Jul 2004 15:28:26 +0000 Subject: [PATCH] PyThreadState_Swap(NULL) didn't do what I thought it did. Fixes [ 987287 ] Python 2.4a1, interpreter hanging on Keyboard Interrupt --- Modules/readline.c | 2 +- Parser/myreadline.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/readline.c b/Modules/readline.c index 8285d33afdb..abcc9c64863 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -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(); diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 979e34f00d6..7fc421e9d10 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -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; }