summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-05 11:07:14 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-05 11:07:14 (GMT)
commitd3eaa745a95c814061fd5962d9d887ea5b2af9f0 (patch)
tree86fd636718f9c132ae1e850b91e2b6e4c9b27de5 /Objects/object.c
parent1e566cec6f8093018cf8fd1870124c0abd11a6cd (diff)
downloadcpython-d3eaa745a95c814061fd5962d9d887ea5b2af9f0.zip
cpython-d3eaa745a95c814061fd5962d9d887ea5b2af9f0.tar.gz
cpython-d3eaa745a95c814061fd5962d9d887ea5b2af9f0.tar.bz2
#5615: make it possible to configure --without-threads again.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 69fb6de..7395b0c 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -336,11 +336,17 @@ void _PyObject_Dump(PyObject* op)
if (op == NULL)
fprintf(stderr, "NULL\n");
else {
+#ifdef WITH_THREAD
PyGILState_STATE gil;
+#endif
fprintf(stderr, "object : ");
+#ifdef WITH_THREAD
gil = PyGILState_Ensure();
+#endif
(void)PyObject_Print(op, stderr, 0);
+#ifdef WITH_THREAD
PyGILState_Release(gil);
+#endif
/* XXX(twouters) cast refcount to long until %zd is
universally available */
fprintf(stderr, "\n"