# HG changeset patch # User Steve Borho # Date 2009-01-29 02:06:59 # Node ID 998fc8f62539ee26601d526803d6da2476129411 # Parent 9294c0158c42ce8f8dd884e214386a29d91d6ca4 close sockets on httprepository deletion (issue1487) With this destructor in place, I no longer see tracebacks on the server after using win32 clients for pull, push, etc. diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -38,6 +38,12 @@ class httprepository(repo.repository): self.urlopener = url.opener(ui, authinfo) + def __del__(self): + for h in self.urlopener.handlers: + h.close() + if hasattr(h, "close_all"): + h.close_all() + def url(self): return self.path