From: Berker Peksag Date: Fri, 17 Jun 2016 10:25:01 +0000 (+0300) Subject: Issue #27336: Fix compilation failures --without-threads X-Git-Tag: v3.6.0a3~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=531396c764d12ca6ec02a4e199350fee1879499a;p=python Issue #27336: Fix compilation failures --without-threads --- diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c index d5a13fef34..e9d308234b 100644 --- a/Parser/pgenmain.c +++ b/Parser/pgenmain.c @@ -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) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 7187fe448a..12a5d4c8b7 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -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) diff --git a/Python/traceback.c b/Python/traceback.c index 62a6b1e1a2..59552cae85 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -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) {