summaryrefslogtreecommitdiff
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-05 21:27:50 +0000
committerGuido van Rossum <guido@python.org>1997-08-05 21:27:50 +0000
commit0969d362751bd779fc6618d70ddd6c76e8cbc12c (patch)
tree2a03665642f3e74b7b4e58e758f6529be14923be /Modules/_tkinter.c
parent570278be6ea5e3981d20f9ffcfeec27d43cf9770 (diff)
downloadcpython-git-0969d362751bd779fc6618d70ddd6c76e8cbc12c.tar.gz
New mechanism for GNU readline interface, via module
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 528c2296a8..1f32c4a492 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1428,11 +1428,9 @@ static PyMethodDef moduleMethods[] =
{NULL, NULL}
};
-#ifdef WITH_READLINE
static int
EventHook()
{
- /* XXX Reset tty */
if (errorInCmd) {
errorInCmd = 0;
PyErr_Restore(excInCmd, valInCmd, trbInCmd);
@@ -1443,7 +1441,6 @@ EventHook()
Tcl_DoOneEvent(TCL_DONT_WAIT);
return 0;
}
-#endif /* WITH_READLINE */
/* all errors will be checked in one fell swoop in init_tkinter() */
@@ -1476,9 +1473,7 @@ ins_string(d, name, val)
void
init_tkinter()
{
-#ifdef WITH_READLINE
- extern int (*rl_event_hook) ();
-#endif /* WITH_READLINE */
+ extern int (*Py_input_hook) ();
PyObject *m, *d;
Tkapp_Type.ob_type = &PyType_Type;
@@ -1502,9 +1497,8 @@ init_tkinter()
ins_string(d, "TK_VERSION", TK_VERSION);
ins_string(d, "TCL_VERSION", TCL_VERSION);
-#ifdef WITH_READLINE
- rl_event_hook = EventHook;
-#endif /* WITH_READLINE */
+ if (Py_input_hook == NULL)
+ Py_input_hook = EventHook;
if (PyErr_Occurred())
Py_FatalError("can't initialize module _tkinter");