httprepo: use getattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 15:37:52 -0500
changeset 14955 6349a9eb0178
parent 14954 ce7e3014fda7
child 14956 1b3f5f603aef
httprepo: use getattr instead of hasattr
mercurial/httprepo.py
--- a/mercurial/httprepo.py	Mon Jul 25 15:36:13 2011 -0500
+++ b/mercurial/httprepo.py	Mon Jul 25 15:37:52 2011 -0500
@@ -44,8 +44,7 @@
     def __del__(self):
         for h in self.urlopener.handlers:
             h.close()
-            if hasattr(h, "close_all"):
-                h.close_all()
+            getattr(h, "close_all", lambda : None)()
 
     def url(self):
         return self.path