Rev 5279: Fix broken helper. in file:///home/vila/src/bzr/experimental/leaking-tests/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jun 10 18:01:42 BST 2010
At file:///home/vila/src/bzr/experimental/leaking-tests/
------------------------------------------------------------
revno: 5279
revision-id: v.ladeuil+lp at free.fr-20100610170142-ofbnlol41iis4g9e
parent: v.ladeuil+lp at free.fr-20100607165530-jnix5v6ic2x7c973
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: propagate-exceptions
timestamp: Thu 2010-06-10 19:01:42 +0200
message:
Fix broken helper.
* bzrlib/osutils.py:
(connect_socket): Fix to pass the tests with python-2.4/2.5.
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2010-06-05 17:06:04 +0000
+++ b/bzrlib/osutils.py 2010-06-10 17:01:42 +0000
@@ -2038,7 +2038,8 @@
# We don't use nor handle the timeout though
def connect_socket(address, timeout=None):
err = socket.error('getaddrinfo returns an empty list')
- for res in socket.getaddrinfo(*address):
+ host, port = address
+ for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
@@ -2046,11 +2047,11 @@
sock.connect(sa)
return sock
- except socket.error, err:
+ except exc_class, err:
# 'err' is now the most recent error
if sock is not None:
sock.close()
- raise err
+ raise exc_class, err
def dereference_path(path):
More information about the bazaar-commits
mailing list