diff options
author | Guido van Rossum <guido@python.org> | 1998-11-17 03:45:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-11-17 03:45:24 (GMT) |
commit | e9bc62d993e050fbc0a2b6a5a8b1cee228705196 (patch) | |
tree | 164be9cad3c21c05c979593070b379f4f6f09aa3 /Modules | |
parent | f05fc716d1a113b3556d1ff0f5389d688e80e5c6 (diff) | |
download | cpython-e9bc62d993e050fbc0a2b6a5a8b1cee228705196.zip cpython-e9bc62d993e050fbc0a2b6a5a8b1cee228705196.tar.gz cpython-e9bc62d993e050fbc0a2b6a5a8b1cee228705196.tar.bz2 |
RajGopal Srinivasan noted that the latest code doesn't work when
running in a non-threaded environment. He added some #ifdefs that fix
this.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 5939a06..86a4e58 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1902,7 +1902,9 @@ EventHook() #ifndef MS_WINDOWS FHANDLE tfile; #endif +#ifdef WITH_THREAD PyEval_RestoreThread(event_tstate); +#endif stdin_ready = 0; errorInCmd = 0; #ifndef MS_WINDOWS @@ -1945,7 +1947,9 @@ EventHook() excInCmd = valInCmd = trbInCmd = NULL; PyErr_Print(); } +#ifdef WITH_THREAD PyEval_SaveThread(); +#endif return 0; } @@ -1956,7 +1960,9 @@ EnableEventHook() { #ifdef WAIT_FOR_STDIN if (PyOS_InputHook == NULL) { +#ifdef WITH_THREAD event_tstate = PyThreadState_Get(); +#endif PyOS_InputHook = EventHook; } #endif |