diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-09-17 03:28:34 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-09-17 03:28:34 (GMT) |
commit | 0153159e67bf4247c4402a1a6e717819372c9337 (patch) | |
tree | ef58a6813bfb4011b0cd542f250f292f8cba8076 /Objects/listobject.c | |
parent | d36a60e1e3410450d337d4de732e127e48a6a042 (diff) | |
download | cpython-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.c | 11 |
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; } |