httprepo: use getattr instead of hasattr

This commit is contained in:
Augie Fackler 2011-07-25 15:37:52 -05:00
parent 43844331a5
commit b61457dbf9

View File

@ -44,8 +44,7 @@ class httprepository(wireproto.wirerepository):
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