--- 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