mercurial/error.py
changeset 45682 d2e1dcd4490d
parent 45680 bb1a988ef4a5
child 45775 5bb900885311
equal deleted inserted replaced
45681:a736ab681b78 45682:d2e1dcd4490d
   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,