~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-30 15:19:36 UTC
  • mto: (5247.6.7 http-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100630151936-bwh082le0i52p8ez
Fixed as per jam's review.

* bzrlib/tests/test_server.py:
* bzrlib/tests/test_http.py:
* bzrlib/tests/http_server.py:
* bzrlib/tests/ftp_server/pyftpdlib_based.py:
* bzrlib/tests/ftp_server/medusa_based.py:
Use sys.stderr.write() rather than print for thread dbugging trace.

* bzrlib/osutils.py:
(connect_socket): Remove the timeout parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2065
2065
            report_activity(sent, 'write')
2066
2066
 
2067
2067
 
2068
 
def connect_socket(address, timeout=None):
2069
 
    # Slight variation of the socket.create_connection() function (provided
2070
 
    # by python-2.6) that can fail if getaddrinfo returns an empty list. We
2071
 
    # also provide it for previous python versions. Also, we don't use the
2072
 
    # timeout parameter so we don't implement it either.
 
2068
def connect_socket(address):
 
2069
    # Slight variation of the socket.create_connection() function (provided by
 
2070
    # python-2.6) that can fail if getaddrinfo returns an empty list. We also
 
2071
    # provide it for previous python versions. Also, we don't use the timeout
 
2072
    # parameter (provided by the python implementation) so we don't implement
 
2073
    # it either).
2073
2074
    err = socket.error('getaddrinfo returns an empty list')
2074
2075
    host, port = address
2075
2076
    for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):