- 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;