Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit adf8769

Browse files
committed
Separate readline initialization into new function PyOS_ReadlineInit().
For Dave Ascher's readline extensions.
1 parent d170577 commit adf8769

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

Parser/myreadline.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,28 @@ my_fgets(buf, len, fp)
100100
#endif /* WITH_READLINE */
101101

102102

103-
char *
104-
my_readline(prompt)
105-
char *prompt;
103+
void
104+
PyOS_ReadlineInit()
106105
{
107-
int n;
108-
char *p;
109-
#ifdef WITH_READLINE
110-
RETSIGTYPE (*old_inthandler)();
111106
static int been_here;
112107
if (!been_here) {
113108
/* Force rebind of TAB to insert-tab */
114109
extern int rl_insert();
115110
rl_bind_key('\t', rl_insert);
116111
been_here++;
117112
}
113+
}
114+
115+
116+
char *
117+
my_readline(prompt)
118+
char *prompt;
119+
{
120+
int n;
121+
char *p;
122+
#ifdef WITH_READLINE
123+
RETSIGTYPE (*old_inthandler)();
124+
PyOS_ReadlineInit();
118125
old_inthandler = signal(SIGINT, onintr);
119126
if (setjmp(jbuf)) {
120127
#ifdef HAVE_SIGRELSE

0 commit comments

Comments
 (0)