]> granicus.if.org Git - python/commitdiff
RajGopal Srinivasan noted that the latest code doesn't work when
authorGuido van Rossum <guido@python.org>
Tue, 17 Nov 1998 03:45:24 +0000 (03:45 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 17 Nov 1998 03:45:24 +0000 (03:45 +0000)
running in a non-threaded environment.  He added some #ifdefs that fix
this.

Modules/_tkinter.c

index 5939a06da00fa03266b9e396ed5826f36e58ea68..86a4e589cb33335b8a998f5e63f6daf34c7eb15e 100644 (file)
@@ -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