commit | 3b1e6b2f833d1e030b2ff853e1a942dc0de968f5 | [log] [tgz] |
---|---|---|
author | Gregory P. Smith <greg@mad-scientist.com> | Mon Jul 07 04:31:58 2008 +0000 |
committer | Gregory P. Smith <greg@mad-scientist.com> | Mon Jul 07 04:31:58 2008 +0000 |
tree | 431edbd1f84590c5101f36385778f9ffa6c26eb7 | |
parent | 0f7cddc308b297e6a1c2dd61503acea38401656f [diff] |
- 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.
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 @@ 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;