[Python-checkins] cpython (3.2): Correcting issue 12576 fix, which resulted in buildbot failures.
senthil.kumaran
python-checkins at python.org
Wed Jul 27 03:32:19 CEST 2011
http://hg.python.org/cpython/rev/d58b43fb9208
changeset: 71521:d58b43fb9208
branch: 3.2
parent: 71519:1c8aca41845c
user: Senthil Kumaran <senthil at uthcode.com>
date: Wed Jul 27 09:31:03 2011 +0800
summary:
Correcting issue 12576 fix, which resulted in buildbot failures.
files:
Lib/urllib/request.py | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1135,13 +1135,10 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list