]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Return a write method from start_response, as required by the wsgi spec.
authorBen Darnell <bdarnell@beaker.local>
Wed, 31 Mar 2010 22:37:29 +0000 (15:37 -0700)
committerBen Darnell <bdarnell@beaker.local>
Wed, 31 Mar 2010 22:37:29 +0000 (15:37 -0700)
tornado/wsgi.py

index 7dab5187008fc2f7aec81b4c5a633b3520786be3..69fa0988ebb767ce6b5a14ff0c5a4430063dc706 100644 (file)
@@ -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()