Commit 9b7e977b authored by Denis Bilenko's avatar Denis Bilenko

wsgi: close the iterator

parent 0c4d78ad
...@@ -103,7 +103,11 @@ class WSGIHandler(object): ...@@ -103,7 +103,11 @@ class WSGIHandler(object):
try: try:
try: try:
result = server.application(env, self.start_response) result = server.application(env, self.start_response)
try:
self.data.extend(result) self.data.extend(result)
finally:
if hasattr(result, 'close'):
result.close()
except: except:
traceback.print_exc() traceback.print_exc()
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment