# HG changeset patch # User Alexis S. L. Carvalho # Date 1202079826 7200 # Node ID b6bd4ee6ed85628b26d6cd7186b76624f40548bf # Parent ca2af0c81c9adca727c95d4d7786fe8883a129db move __del__ from httprepository to basehttphandler This should prevent the next patch from reopening an issue fixed by 0d94e4a3ddb4. diff -r ca2af0c81c9a -r b6bd4ee6ed85 mercurial/httprepo.py --- a/mercurial/httprepo.py Sun Feb 03 21:03:46 2008 -0200 +++ b/mercurial/httprepo.py Sun Feb 03 21:03:46 2008 -0200 @@ -107,6 +107,9 @@ def http_open(self, req): return self.do_open(httpconnection, req) + def __del__(self): + self.close_all() + has_https = hasattr(urllib2, 'HTTPSHandler') if has_https: class httpsconnection(httplib.HTTPSConnection): @@ -203,8 +206,7 @@ proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy') # XXX proxyauthinfo = None - self.handler = httphandler() - handlers = [self.handler] + handlers = [httphandler()] if proxyurl: # proxy can be proper url or host[:port] @@ -270,11 +272,6 @@ opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] urllib2.install_opener(opener) - def __del__(self): - if self.handler: - self.handler.close_all() - self.handler = None - def url(self): return self.path