[Python-checkins] cpython: Issue #27336: Fix compilation failures --without-threads
berker.peksag
python-checkins at python.org
Fri Jun 17 06:24:23 EDT 2016
https://hg.python.org/cpython/rev/2baaf7e31b13
changeset: 102071:2baaf7e31b13
user: Berker Peksag <berker.peksag at gmail.com>
date: Fri Jun 17 13:25:01 2016 +0300
summary:
Issue #27336: Fix compilation failures --without-threads
files:
Parser/pgenmain.c | 5 +++--
Python/pylifecycle.c | 2 ++
Python/traceback.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -38,12 +38,13 @@
}
#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
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -746,9 +746,11 @@
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
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -745,7 +745,7 @@
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) {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list