diff options
author | Éric Araujo <merwok@netwok.org> | 2011-07-28 23:08:11 +0200 |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-07-28 23:08:11 +0200 |
commit | cf534817adc49b2562d175fabd3e3992d25063fe (patch) | |
tree | d2cb18e71d6b5cc25384146751b00c2172a327b6 /Lib/urllib/request.py | |
parent | 9e1af03fbb2a9fc1472ac866add02c99b0c88b16 (diff) | |
parent | fc662ddda2bfd43b10c0a4f8a814e36445f22515 (diff) | |
download | cpython-git-cf534817adc49b2562d175fabd3e3992d25063fe.tar.gz |
Branch merge
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index a09a35348c..1dda966a23 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1134,11 +1134,11 @@ class AbstractHTTPHandler(BaseHandler): try: h.request(req.get_method(), req.selector, req.data, headers) - r = h.getresponse() # an HTTPResponse instance - except socket.error as err: - raise URLError(err) - finally: + except socket.error as err: # timeout error h.close() + raise URLError(err) + else: + r = h.getresponse() r.url = req.get_full_url() # This line replaces the .msg attribute of the HTTPResponse |