summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/readline.c4
-rw-r--r--Parser/myreadline.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index fa0b85f..e891cef 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.5 alpha 1?
Core and builtins
-----------------
+- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
+ disabled caused a crash.
+
- Bug #1165306: instancemethod_new allowed the creation of a method
with im_class == im_self == NULL, which caused a crash when called.
diff --git a/Modules/readline.c b/Modules/readline.c
index 7802625..25a43b2 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -775,9 +775,13 @@ readline_until_enter_or_signal(char *prompt, int *signal)
}
else if (errno == EINTR) {
int s;
+#ifdef WITH_THREAD
PyEval_RestoreThread(_PyOS_ReadlineTState);
+#endif
s = PyErr_CheckSignals();
+#ifdef WITH_THREAD
PyEval_SaveThread();
+#endif
if (s < 0) {
rl_free_line_state();
rl_cleanup_after_signal();
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 7fc421e..a932a87 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -82,9 +82,13 @@ my_fgets(char *buf, int len, FILE *fp)
#ifdef EINTR
if (errno == EINTR) {
int s;
+#ifdef WITH_THREAD
PyEval_RestoreThread(_PyOS_ReadlineTState);
+#endif
s = PyErr_CheckSignals();
+#ifdef WITH_THREAD
PyEval_SaveThread();
+#endif
if (s < 0) {
return 1;
}