summaryrefslogtreecommitdiffstats
path: root/Parser/myreadline.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/myreadline.c')
-rw-r--r--Parser/myreadline.c4
1 files changed, 4 insertions, 0 deletions
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;
}