# HG changeset patch # User Matt Mackall # Date 1269295413 18000 # Node ID 0d454e1fa14aeb3f31846ea4bcd8093411090c31 # Parent 53313405b54d25f0f30ae64f9df3d33a239cb559# Parent a1cb8ca051c01612ea0e6161b4d4419f6954e251 Merge with stable diff -r 53313405b54d -r 0d454e1fa14a mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py Mon Mar 22 11:08:52 2010 +0100 +++ b/mercurial/hgweb/wsgicgi.py Mon Mar 22 17:03:33 2010 -0500 @@ -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()