/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: John Arbash Meinel
  • Date: 2006-08-21 18:55:40 UTC
  • mto: This revision was merged to the branch mainline in revision 1953.
  • Revision ID: john@arbash-meinel.com-20060821185540-ddfc3823ea4a0dbf
Make sure BzrCommandError can handle unicode arguments

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
    # BzrCommandError, and non-UI code should not throw a subclass of
198
198
    # BzrCommandError.  ADHB 20051211
199
199
    def __init__(self, msg):
200
 
        self.msg = msg
 
200
        # Object.__str__() must return a real string
 
201
        # returning a Unicode string is a python error.
 
202
        if isinstance(msg, unicode):
 
203
            self.msg = msg.encode('utf8')
 
204
        else:
 
205
            self.msg = msg
201
206
 
202
207
    def __str__(self):
203
208
        return self.msg