From: Senthil Kumaran Date: Wed, 27 Jul 2011 01:31:03 +0000 (+0800) Subject: Correcting issue 12576 fix, which resulted in buildbot failures. X-Git-Tag: v3.2.2rc1~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45686b472bf1f9e5ce1ef6953c4b123d271b2dc7;p=thirdparty%2FPython%2Fcpython.git Correcting issue 12576 fix, which resulted in buildbot failures. --- diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 534408d815c5..1dda966a23b3 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1135,13 +1135,10 @@ class AbstractHTTPHandler(BaseHandler): try: h.request(req.get_method(), req.selector, req.data, headers) except socket.error as err: # timeout error + h.close() raise URLError(err) - finally: - try: - r = h.getresponse() # an HTTPResponse instance - except Exception as exp: - h.close() - raise exp + else: + r = h.getresponse() r.url = req.get_full_url() # This line replaces the .msg attribute of the HTTPResponse