Mercurial > hg-stable
changeset 7752:998fc8f62539
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.
author | Steve Borho <steve@borho.org> |
---|---|
date | Wed, 28 Jan 2009 20:06:59 -0600 |
parents | 9294c0158c42 |
children | e617f2e99e61 |
files | mercurial/httprepo.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/httprepo.py Tue Feb 10 13:57:34 2009 +0800 +++ b/mercurial/httprepo.py Wed Jan 28 20:06:59 2009 -0600 @@ -38,6 +38,12 @@ 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