diff mercurial/error.py @ 45902:7eb221b9af6c

errors: make ParseError a subtype of Abort I didn't plan this before, but the previous two changes made it really easy to make `ParseError` a subtype of `Abort`. It seems obvious with hindsight that I *should* have planned it :) Differential Revision: https://phab.mercurial-scm.org/D9350
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 19 Nov 2020 15:13:39 -0800
parents 600aec73f309
children 68260c444fd3
line wrap: on
line diff
--- a/mercurial/error.py	Fri Nov 20 13:24:45 2020 -0800
+++ b/mercurial/error.py	Thu Nov 19 15:13:39 2020 -0800
@@ -259,13 +259,12 @@
     __bytes__ = _tobytes
 
 
-class ParseError(Hint, Exception):
+class ParseError(Abort):
     """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
 
     def __init__(self, message, location=None, hint=None):
-        self.message = message
+        super(ParseError, self).__init__(message, hint=hint)
         self.location = location
-        self.hint = hint
         # Pass the message and possibly location into the Exception constructor
         # to help code that looks for exc.args.
         if location is not None: