branch | stable |
changeset 10753 | a1cb8ca051c0 |
parent 10339 | 23e608f42f2c |
child 13570 | 617a87cb7eb2 |
--- a/mercurial/hgweb/wsgicgi.py Sat Mar 20 14:47:05 2010 +0100 +++ b/mercurial/hgweb/wsgicgi.py Mon Mar 22 15:16:27 2010 +0100 @@ -69,5 +69,9 @@ return write content = application(environ, start_response) - for chunk in content: - write(chunk) + try: + for chunk in content: + write(chunk) + finally: + if hasattr(content, 'close'): + content.close()