##// END OF EJS Templates
httprepo: make __del__ more stable in error situations...
Mads Kiilerich -
r15246:7b15dd91 default
parent child Browse files
Show More
@@ -28,6 +28,7 b' class httprepository(wireproto.wirerepos'
28 28 self.path = path
29 29 self.caps = None
30 30 self.handler = None
31 self.urlopener = None
31 32 u = util.url(path)
32 33 if u.query or u.fragment:
33 34 raise util.Abort(_('unsupported URL component: "%s"') %
@@ -42,9 +43,10 b' class httprepository(wireproto.wirerepos'
42 43 self.urlopener = url.opener(ui, authinfo)
43 44
44 45 def __del__(self):
45 for h in self.urlopener.handlers:
46 h.close()
47 getattr(h, "close_all", lambda : None)()
46 if self.urlopener:
47 for h in self.urlopener.handlers:
48 h.close()
49 getattr(h, "close_all", lambda : None)()
48 50
49 51 def url(self):
50 52 return self.path
@@ -200,4 +200,8 b' Pull -u takes us back to branch foo:'
200 200 date: Thu Jan 01 00:00:00 1970 +0000
201 201 summary: new head of branch foo
202 202
203 Test handling of invalid urls
203 204
205 $ hg id http://foo/?bar
206 abort: unsupported URL component: "bar"
207 [255]
General Comments 0
You need to be logged in to leave comments. Login now