Merge lp:~mitya57/piston-mini-client/lp1105215 into lp:piston-mini-client

Proposed by Dmitry Shachnev
Status: Merged
Approved by: Barry Warsaw
Approved revision: 71
Merged at revision: 71
Proposed branch: lp:~mitya57/piston-mini-client/lp1105215
Merge into: lp:piston-mini-client
Diff against target: 14 lines (+2/-2)
1 file modified
piston_mini_client/__init__.py (+2/-2)
To merge this branch: bzr merge lp:~mitya57/piston-mini-client/lp1105215
Reviewer Review Type Date Requested Status
Barry Warsaw Approve
Review via email: mp+150619@code.launchpad.net

Description of the change

This should fix bug 1105215 (socket.gaierror doesn't have "message" attribute, but has "strerror" instead).

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

If we only care about Python 3.3, maybe it's better to catch OSError, since socket.error is a deprecated alias for OSError now, and socket.gaierror is a subclass of OSError. I guess it's not that big of a deal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'piston_mini_client/__init__.py'
2--- piston_mini_client/__init__.py 2013-02-21 20:29:42 +0000
3+++ piston_mini_client/__init__.py 2013-02-26 17:06:06 +0000
4@@ -426,8 +426,8 @@
5 except socket.timeout as e:
6 raise TimeoutError('Timed out attempting to connect to %s' %
7 (url,))
8- except (socket.gaierror, socket.error) as e:
9- msg = 'connecting to %s: %s' % (url, e.message)
10+ except socket.error as e:
11+ msg = 'connecting to %s: %s' % (url, e.strerror)
12 raise SocketError(msg)
13 if self._log_filename:
14 self._dump_response(response, response_body)

Subscribers

People subscribed via source and target branches