/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

  • Committer: Andrew Bennetts
  • Date: 2008-01-21 00:46:32 UTC
  • mfrom: (3193 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3194.
  • Revision ID: andrew.bennetts@canonical.com-20080121004632-wvpox6g9j7czn4vk
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
            port = BZR_DEFAULT_PORT
546
546
        else:
547
547
            port = int(self._port)
548
 
        result = self._socket.connect_ex((self._host, port))
549
 
        if result:
 
548
        try:
 
549
            self._socket.connect((self._host, port))
 
550
        except socket.error, err:
 
551
            # socket errors either have a (string) or (errno, string) as their
 
552
            # args.
 
553
            if type(err.args) is str:
 
554
                err_msg = err.args
 
555
            else:
 
556
                err_msg = err.args[1]
550
557
            raise errors.ConnectionError("failed to connect to %s:%d: %s" %
551
 
                    (self._host, port, os.strerror(result)))
 
558
                    (self._host, port, err_msg))
552
559
        self._connected = True
553
560
 
554
561
    def _flush(self):