wsgicgi: use getattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 15:38:10 -0500
changeset 14956 1b3f5f603aef
parent 14955 6349a9eb0178
child 14957 16e5271b216f
wsgicgi: use getattr instead of hasattr
mercurial/hgweb/wsgicgi.py
--- 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)()