changeset 10754:0d454e1fa14a

Merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 22 Mar 2010 17:03:33 -0500
parents 53313405b54d (current diff) a1cb8ca051c0 (diff)
children df1b0c8c59cc
files
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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()