summaryrefslogtreecommitdiff
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-07-18 17:05:03 +0200
committerGitHub <noreply@github.com>2017-07-18 17:05:03 +0200
commitf474c5a3f3c1fbc0383800b88e8518d43a52d1d1 (patch)
tree9c29ab7759d4e8b23dcf2ba3f0ff84bf94e9e299 /Modules/readline.c
parentefa26bcd5085279fc4e9ae96d052272a5214c2bd (diff)
downloadcpython-git-f474c5a3f3c1fbc0383800b88e8518d43a52d1d1.tar.gz
bpo-30946: Remove obsolete fallback code in readline module (#2738)
* Remove obsolete fallback code in readline module * Add NEWS * Remove obsolete include * Fix macro on Windows
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 7d32c21f42..f4a5e5adcb 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -7,7 +7,6 @@
/* Standard definitions */
#include "Python.h"
#include <stddef.h>
-#include <setjmp.h>
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
@@ -1180,10 +1179,7 @@ setup_readline(readlinestate *mod_state)
/* Wrapper around GNU readline that handles signals differently. */
-
-#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT)
-
-static char *completed_input_string;
+static char *completed_input_string;
static void
rlhandler(char *text)
{
@@ -1262,47 +1258,6 @@ readline_until_enter_or_signal(const char *prompt, int *signal)
}
-#else
-
-/* Interrupt handler */
-
-static jmp_buf jbuf;
-
-/* ARGSUSED */
-static void
-onintr(int sig)
-{
- longjmp(jbuf, 1);
-}
-
-
-static char *
-readline_until_enter_or_signal(const char *prompt, int *signal)
-{
- PyOS_sighandler_t old_inthandler;
- char *p;
-
- *signal = 0;
-
- old_inthandler = PyOS_setsig(SIGINT, onintr);
- if (setjmp(jbuf)) {
-#ifdef HAVE_SIGRELSE
- /* This seems necessary on SunOS 4.1 (Rasmus Hahn) */
- sigrelse(SIGINT);
-#endif
- PyOS_setsig(SIGINT, old_inthandler);
- *signal = 1;
- return NULL;
- }
- rl_event_hook = PyOS_InputHook;
- p = readline(prompt);
- PyOS_setsig(SIGINT, old_inthandler);
-
- return p;
-}
-#endif /*defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) */
-
-
static char *
call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
{