From f41f86c3dac1310d9e5b61341585896724734de8 Mon Sep 17 00:00:00 2001 From: benoitc Date: Sat, 14 Jun 2014 21:46:35 +0200 Subject: [PATCH] StopIteration shouldn't be catched at this level. fix #790 --- gunicorn/workers/async.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gunicorn/workers/async.py b/gunicorn/workers/async.py index d3cce5fc..4cfa7a86 100644 --- a/gunicorn/workers/async.py +++ b/gunicorn/workers/async.py @@ -114,6 +114,8 @@ class AsyncWorker(base.Worker): respiter.close() if resp.should_close(): raise StopIteration() + except StopIteration: + raise except Exception: if resp and resp.headers_sent: # If the requests have already been sent, we should close the