--- a/mercurial/hgweb/wsgicgi.py Mon Jul 25 15:37:52 2011 -0500 +++ b/mercurial/hgweb/wsgicgi.py Mon Jul 25 15:38:10 2011 -0500 @@ -78,5 +78,4 @@ for chunk in content: write(chunk) finally: - if hasattr(content, 'close'): - content.close() + getattr(content, 'close', lambda : None)()