summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-09-17 03:28:34 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-09-17 03:28:34 (GMT)
commit0153159e67bf4247c4402a1a6e717819372c9337 (patch)
treeef58a6813bfb4011b0cd542f250f292f8cba8076 /Objects/listobject.c
parentd36a60e1e3410450d337d4de732e127e48a6a042 (diff)
downloadcpython-0153159e67bf4247c4402a1a6e717819372c9337.zip
cpython-0153159e67bf4247c4402a1a6e717819372c9337.tar.gz
cpython-0153159e67bf4247c4402a1a6e717819372c9337.tar.bz2
Add a bunch of GIL release/acquire points in tp_print implementations and for
PyObject_Print(). Closes issue #1164.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 92bad8c..a3fa983 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -282,19 +282,28 @@ list_print(PyListObject *op, FILE *fp, int flags)
if (rc != 0) {
if (rc < 0)
return rc;
+ Py_BEGIN_ALLOW_THREADS
fprintf(fp, "[...]");
+ Py_END_ALLOW_THREADS
return 0;
}
+ Py_BEGIN_ALLOW_THREADS
fprintf(fp, "[");
+ Py_END_ALLOW_THREADS
for (i = 0; i < Py_Size(op); i++) {
- if (i > 0)
+ if (i > 0) {
+ Py_BEGIN_ALLOW_THREADS
fprintf(fp, ", ");
+ Py_END_ALLOW_THREADS
+ }
if (PyObject_Print(op->ob_item[i], fp, 0) != 0) {
Py_ReprLeave((PyObject *)op);
return -1;
}
}
+ Py_BEGIN_ALLOW_THREADS
fprintf(fp, "]");
+ Py_END_ALLOW_THREADS
Py_ReprLeave((PyObject *)op);
return 0;
}