/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/client.py

  • Committer: Jelmer Vernooij
  • Date: 2017-02-05 22:51:57 UTC
  • mto: (6621.2.1 py3)
  • mto: This revision was merged to the branch mainline in revision 6624.
  • Revision ID: jelmer@jelmer.uk-20170205225157-jdk9ppega9c3my86
Run 2to3 idioms fixer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
    def call_with_body_bytes(self, method, args, body):
75
75
        """Call a method on the remote server with body bytes."""
76
 
        if type(method) is not str:
 
76
        if not isinstance(method, str):
77
77
            raise TypeError('method must be a byte string, not %r' % (method,))
78
78
        for arg in args:
79
 
            if type(arg) is not str:
 
79
            if not isinstance(arg, str):
80
80
                raise TypeError('args must be byte strings, not %r' % (args,))
81
 
        if type(body) is not str:
 
81
        if not isinstance(body, str):
82
82
            raise TypeError('body must be byte string, not %r' % (body,))
83
83
        response, response_handler = self._call_and_read_response(
84
84
            method, args, body=body, expect_response_body=False)
86
86
 
87
87
    def call_with_body_bytes_expecting_body(self, method, args, body):
88
88
        """Call a method on the remote server with body bytes."""
89
 
        if type(method) is not str:
 
89
        if not isinstance(method, str):
90
90
            raise TypeError('method must be a byte string, not %r' % (method,))
91
91
        for arg in args:
92
 
            if type(arg) is not str:
 
92
            if not isinstance(arg, str):
93
93
                raise TypeError('args must be byte strings, not %r' % (args,))
94
 
        if type(body) is not str:
 
94
        if not isinstance(body, str):
95
95
            raise TypeError('body must be byte string, not %r' % (body,))
96
96
        response, response_handler = self._call_and_read_response(
97
97
            method, args, body=body, expect_response_body=True)
344
344
        return '<%s %r>' % (self.__class__.__name__, attrs)
345
345
 
346
346
    def __eq__(self, other):
347
 
        if type(other) is not type(self):
 
347
        if not isinstance(other, type(self)):
348
348
            return NotImplemented
349
349
        return self.__dict__ == other.__dict__
350
350