Merge with stable
authorMatt Mackall <mpm@selenic.com>
Mon, 22 Mar 2010 17:03:33 -0500
changeset 10754 0d454e1fa14a
parent 10752 53313405b54d (current diff)
parent 10753 a1cb8ca051c0 (diff)
child 10764 df1b0c8c59cc
Merge with stable
--- 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()