Mercurial > public > mercurial-scm > hg-stable
diff mercurial/httprepo.py @ 14955:6349a9eb0178
httprepo: use getattr instead of hasattr
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 15:37:52 -0500 |
parents | ba3c36cea66e |
children | f6a737357195 |
line wrap: on
line diff
--- 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