/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 breezy/errors.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from __future__ import absolute_import
21
21
 
 
22
from .sixish import (
 
23
    PY3,
 
24
    )
22
25
 
23
26
# TODO: is there any value in providing the .args field used by standard
24
27
# python exceptions?   A list of values with no names seems less useful
105
108
               getattr(self, '_fmt', None),
106
109
               err)
107
110
 
108
 
    __str__ = _format
 
111
    if PY3:
 
112
        __str__ = _format
 
113
    else:
 
114
        def __str__(self):
 
115
            return self._format().encode('utf-8')
 
116
 
 
117
        __unicode__ = _format
109
118
 
110
119
    def __repr__(self):
111
120
        return '%s(%s)' % (self.__class__.__name__, str(self))
173
182
        self.transport = transport
174
183
 
175
184
 
 
185
class InvalidEntryName(InternalBzrError):
 
186
 
 
187
    _fmt = "Invalid entry name: %(name)s"
 
188
 
 
189
    def __init__(self, name):
 
190
        BzrError.__init__(self)
 
191
        self.name = name
 
192
 
 
193
 
176
194
class InvalidRevisionNumber(BzrError):
177
195
 
178
196
    _fmt = "Invalid revision number %(revno)s"