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

  • Committer: Robert Collins
  • Date: 2007-09-27 21:11:38 UTC
  • mfrom: (2871 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070927211138-ebsu1bo1qz9f1w8n
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        try:
96
96
            fmt = self._get_format_string()
97
97
            if fmt:
98
 
                s = fmt % self.__dict__
 
98
                d = dict(self.__dict__)
 
99
                # special case: python2.5 puts the 'message' attribute in a
 
100
                # slot, so it isn't seen in __dict__
 
101
                d['message'] = getattr(self, 'message', 'no message')
 
102
                s = fmt % d
99
103
                # __str__() should always return a 'str' object
100
104
                # never a 'unicode' object.
101
105
                if isinstance(s, unicode):
783
787
    # New code should prefer to raise specific subclasses
784
788
    def __init__(self, message):
785
789
        # Python 2.5 uses a slot for StandardError.message,
786
 
        # so use a different variable name
787
 
        # so it is exposed in self.__dict__
 
790
        # so use a different variable name.  We now work around this in
 
791
        # BzrError.__str__, but this member name is kept for compatability.
788
792
        self.msg = message
789
793
 
790
794