# HG changeset patch # User Alexis S. L. Carvalho # Date 2008-02-03 23:03:46 # 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 --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -107,6 +107,9 @@ class basehttphandler(keepalive.HTTPHand 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 @@ class httprepository(remoterepository): 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 @@ class httprepository(remoterepository): 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