/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-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

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
 
    )
25
22
 
26
23
# TODO: is there any value in providing the .args field used by standard
27
24
# python exceptions?   A list of values with no names seems less useful
108
105
               getattr(self, '_fmt', None),
109
106
               err)
110
107
 
111
 
    if PY3:
112
 
        __str__ = _format
113
 
    else:
114
 
        def __str__(self):
115
 
            return self._format().encode('utf-8')
116
 
 
117
 
        __unicode__ = _format
 
108
    __str__ = _format
118
109
 
119
110
    def __repr__(self):
120
111
        return '%s(%s)' % (self.__class__.__name__, str(self))
182
173
        self.transport = transport
183
174
 
184
175
 
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
 
 
194
176
class InvalidRevisionNumber(BzrError):
195
177
 
196
178
    _fmt = "Invalid revision number %(revno)s"