~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

(jelmer) Use the absolute_import feature everywhere in bzrlib,
 and add a source test to make sure it's used everywhere. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    debug,
44
44
    errors,
45
45
    trace,
46
 
    transport,
47
46
    ui,
48
47
    urlutils,
49
48
    )
910
909
        except IOError, e:
911
910
            if e.errno in (errno.EINVAL, errno.EPIPE):
912
911
                raise errors.ConnectionReset(
913
 
                    "Error trying to write to subprocess", e)
 
912
                    "Error trying to write to subprocess:\n%s" % (e,))
914
913
            raise
915
914
        self._report_activity(len(bytes), 'write')
916
915
 
1022
1021
            raise AssertionError(
1023
1022
                "Unexpected io_kind %r from %r"
1024
1023
                % (io_kind, self._ssh_connection))
1025
 
        for hook in transport.Transport.hooks["post_connect"]:
1026
 
            hook(self)
1027
1024
 
1028
1025
    def _flush(self):
1029
1026
        """See SmartClientStreamMedium._flush()."""
1043
1040
 
1044
1041
class SmartClientSocketMedium(SmartClientStreamMedium):
1045
1042
    """A client medium using a socket.
1046
 
 
 
1043
    
1047
1044
    This class isn't usable directly.  Use one of its subclasses instead.
1048
1045
    """
1049
1046
 
1132
1129
            raise errors.ConnectionError("failed to connect to %s:%d: %s" %
1133
1130
                    (self._host, port, err_msg))
1134
1131
        self._connected = True
1135
 
        for hook in transport.Transport.hooks["post_connect"]:
1136
 
            hook(self)
1137
1132
 
1138
1133
 
1139
1134
class SmartClientAlreadyConnectedSocketMedium(SmartClientSocketMedium):