summaryrefslogtreecommitdiffstats
path: root/Modules/bz2module.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-07-07 04:31:58 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-07-07 04:31:58 (GMT)
commit3b1e6b2f833d1e030b2ff853e1a942dc0de968f5 (patch)
tree431edbd1f84590c5101f36385778f9ffa6c26eb7 /Modules/bz2module.c
parent0f7cddc308b297e6a1c2dd61503acea38401656f (diff)
downloadcpython-3b1e6b2f833d1e030b2ff853e1a942dc0de968f5.zip
cpython-3b1e6b2f833d1e030b2ff853e1a942dc0de968f5.tar.gz
cpython-3b1e6b2f833d1e030b2ff853e1a942dc0de968f5.tar.bz2
- Issue #3309: Fix bz2.BZFile itererator to release its internal lock
properly when raising an exception due to the bz2file being closed. Prevents a deadlock.
Diffstat (limited to 'Modules/bz2module.c')
-rw-r--r--Modules/bz2module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index bbabe10..16201bd 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1451,6 +1451,7 @@ BZ2File_iternext(BZ2FileObject *self)
PyStringObject* ret;
ACQUIRE_LOCK(self);
if (self->mode == MODE_CLOSED) {
+ RELEASE_LOCK(self);
PyErr_SetString(PyExc_ValueError,
"I/O operation on closed file");
return NULL;