summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-08-17 23:06:19 +0000
committerGregory P. Smith <greg@mad-scientist.com>2008-08-17 23:06:19 +0000
commitaee7bfca791e902bae025f9980d54a2ddcebd2a9 (patch)
tree965bd702b0422eb870def480293fe59d23cf9c42 /Modules
parent6ecda3b5a5f01f3846237a64ccdff956091d8048 (diff)
downloadcpython-aee7bfca791e902bae025f9980d54a2ddcebd2a9.tar.gz
Backport of r64767 from trunk
Fixes Issue #3309: Fix bz2.BZFile iterator to release its internal lock properly when raising an exception due to the bz2file being closed. Prevents a deadlock.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/bz2module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 9e868c5eb6..73de628e86 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1437,6 +1437,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;