equal
deleted
inserted
replaced
153 |
153 |
154 |
154 |
155 class Abort(Hint, Exception): |
155 class Abort(Hint, Exception): |
156 """Raised if a command needs to print an error and exit.""" |
156 """Raised if a command needs to print an error and exit.""" |
157 |
157 |
158 __bytes__ = _tobytes |
158 def __init__(self, message, hint=None): |
|
159 self.message = message |
|
160 self.hint = hint |
|
161 # Pass the message into the Exception constructor to help extensions |
|
162 # that look for exc.args[0]. |
|
163 Exception.__init__(self, message) |
|
164 |
|
165 def __bytes__(self): |
|
166 return self.message |
159 |
167 |
160 if pycompat.ispy3: |
168 if pycompat.ispy3: |
161 |
169 |
162 def __str__(self): |
170 def __str__(self): |
163 # the output would be unreadable if the message was translated, |
171 # the output would be unreadable if the message was translated, |