diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-08-17 23:06:19 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-08-17 23:06:19 +0000 |
commit | aee7bfca791e902bae025f9980d54a2ddcebd2a9 (patch) | |
tree | 965bd702b0422eb870def480293fe59d23cf9c42 /Modules | |
parent | 6ecda3b5a5f01f3846237a64ccdff956091d8048 (diff) | |
download | cpython-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.c | 1 |
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; |