mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
* tkintermodule.c: OK, I've fixed the "tty" problem. You're right
no need for the stdin handler, a Tk_DoOneEvent(TK_DONT_WAIT) did the trick. I've included a diff to tkintermodule.c.
This commit is contained in:
parent
46f24027f4
commit
e2ca9bd156
1 changed files with 1 additions and 14 deletions
|
@ -33,7 +33,6 @@ typedef struct methodlist PyMethodDef;
|
||||||
#include <tk.h>
|
#include <tk.h>
|
||||||
|
|
||||||
extern char *getprogramname ();
|
extern char *getprogramname ();
|
||||||
extern int isatty (int);
|
|
||||||
|
|
||||||
/* Internal declarations from tkInt.h. */
|
/* Internal declarations from tkInt.h. */
|
||||||
extern int tk_NumMainWindows;
|
extern int tk_NumMainWindows;
|
||||||
|
@ -1012,19 +1011,11 @@ EventHook ()
|
||||||
PyErr_Print ();
|
PyErr_Print ();
|
||||||
}
|
}
|
||||||
if (tk_NumMainWindows > 0)
|
if (tk_NumMainWindows > 0)
|
||||||
Tk_DoOneEvent (0);
|
Tk_DoOneEvent (TK_DONT_WAIT);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* WITH_READLINE */
|
#endif /* WITH_READLINE */
|
||||||
|
|
||||||
static void
|
|
||||||
StdinProc (clientData, mask)
|
|
||||||
ClientData clientData;
|
|
||||||
int mask;
|
|
||||||
{
|
|
||||||
/* Do nothing. */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Tkinter_Cleanup ()
|
Tkinter_Cleanup ()
|
||||||
{
|
{
|
||||||
|
@ -1056,10 +1047,6 @@ PyInit_tkinter ()
|
||||||
v = Py_BuildValue ("i", TK_EXCEPTION);
|
v = Py_BuildValue ("i", TK_EXCEPTION);
|
||||||
PyDict_SetItemString (d, "EXCEPTION", v);
|
PyDict_SetItemString (d, "EXCEPTION", v);
|
||||||
|
|
||||||
/* Unblock stdin. */
|
|
||||||
if (isatty (0))
|
|
||||||
Tk_CreateFileHandler (0, TK_READABLE, StdinProc, (ClientData) 0);
|
|
||||||
|
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
rl_event_hook = EventHook;
|
rl_event_hook = EventHook;
|
||||||
#endif /* WITH_READLINE */
|
#endif /* WITH_READLINE */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue