mercurial/error.py
changeset 45776 0fc8b066928a
parent 45775 5bb900885311
child 45825 8f07f5a9c3de
--- a/mercurial/error.py	Tue Oct 20 08:58:20 2020 -0700
+++ b/mercurial/error.py	Thu Oct 22 09:58:05 2020 -0700
@@ -224,6 +224,17 @@
 class ParseError(Hint, Exception):
     """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
 
+    def __init__(self, message, location=None, hint=None):
+        self.message = message
+        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:
+            Exception.__init__(self, message, location)
+        else:
+            Exception.__init__(self, message)
+
     __bytes__ = _tobytes