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/object.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/object.c')
-rw-r--r-- | Objects/object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index 4330b08..0651d6b6 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -279,14 +279,18 @@ internal_print(PyObject *op, FILE *fp, int flags, int nesting) #endif clearerr(fp); /* Clear any previous error condition */ if (op == NULL) { + Py_BEGIN_ALLOW_THREADS fprintf(fp, "<nil>"); + Py_END_ALLOW_THREADS } else { if (op->ob_refcnt <= 0) /* XXX(twouters) cast refcount to long until %zd is universally available */ + Py_BEGIN_ALLOW_THREADS fprintf(fp, "<refcnt %ld at %p>", (long)op->ob_refcnt, op); + Py_END_ALLOW_THREADS else if (Py_Type(op)->tp_print == NULL) { PyObject *s; if (flags & Py_PRINT_RAW) |