]> granicus.if.org Git - python/commitdiff
Issue #27336: Fix compilation failures --without-threads
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 17 Jun 2016 10:25:01 +0000 (13:25 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 17 Jun 2016 10:25:01 +0000 (13:25 +0300)
Parser/pgenmain.c
Python/pylifecycle.c
Python/traceback.c

index d5a13fef34733256d33179ba4f31430be8586295..e9d308234b93be69c052d3e762fa384c49e06b4a 100644 (file)
@@ -38,12 +38,13 @@ Py_Exit(int sts)
 }
 
 #ifdef WITH_THREAD
-/* Functions needed by obmalloc.c */
+/* Needed by obmalloc.c */
 int PyGILState_Check(void)
 { return 1; }
+#endif
+
 void _PyMem_DumpTraceback(int fd, const void *ptr)
 {}
-#endif
 
 int
 main(int argc, char **argv)
index 7187fe448abec52d1be4d0958f6470666774d055..12a5d4c8b7a5882cbfdac500c85b48b5cff2d834 100644 (file)
@@ -746,9 +746,11 @@ Py_NewInterpreter(void)
     if (!initialized)
         Py_FatalError("Py_NewInterpreter: call Py_Initialize first");
 
+#if WITH_THREAD
     /* Issue #10915, #15751: The GIL API doesn't work with multiple
        interpreters: disable PyGILState_Check(). */
     _PyGILState_check_enabled = 0;
+#endif
 
     interp = PyInterpreterState_New();
     if (interp == NULL)
index 62a6b1e1a23466b741f5ae5b1f13e58525e24a16..59552cae85e7929075327e547c749c120b24b1b2 100644 (file)
@@ -745,7 +745,7 @@ _Py_DumpTracebackThreads(int fd, PyInterpreterState *interp,
     if (current_tstate == NULL) {
         /* Call _PyThreadState_UncheckedGet() instead of PyThreadState_Get()
            to not fail with a fatal error if the thread state is NULL. */
-        current_thread = _PyThreadState_UncheckedGet();
+        current_tstate = _PyThreadState_UncheckedGet();
     }
 
     if (interp == NULL) {