Merge "check response status in WSGIContext._app_call"

This commit is contained in:
Jenkins 2012-11-16 22:36:59 +00:00 committed by Gerrit Code Review
commit ac7829f370
1 changed files with 5 additions and 1 deletions

View File

@ -262,7 +262,11 @@ class WSGIContext(object):
""" """
Ensures start_response has been called before returning. Ensures start_response has been called before returning.
""" """
resp = iter(self.app(env, self._start_response)) resp = self.app(env, self._start_response)
# if start_response has been called, just return the iter
if self._response_status is not None:
return resp
resp = iter(resp)
try: try:
first_chunk = resp.next() first_chunk = resp.next()
except StopIteration: except StopIteration: