From: Ben Darnell Date: Wed, 31 Mar 2010 22:37:29 +0000 (-0700) Subject: Return a write method from start_response, as required by the wsgi spec. X-Git-Tag: v1.0.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f4413bec42dcccce2d85f1421b49218fc5d6712;p=thirdparty%2Ftornado.git Return a write method from start_response, as required by the wsgi spec. --- diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 7dab51870..69fa0988e 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -211,11 +211,13 @@ class WSGIContainer(object): def __call__(self, request): data = {} + response = [] def start_response(status, response_headers, exc_info=None): data["status"] = status data["headers"] = response_headers - response = self.wsgi_application( - WSGIContainer.environ(request), start_response) + return response.append + response.extend(self.wsgi_application( + WSGIContainer.environ(request), start_response)) body = "".join(response) if hasattr(response, "close"): response.close()