mercurial/error.py
changeset 45891 da178b816812
parent 45890 68260c444fd3
child 45894 9dc1351d0b5f
equal deleted inserted replaced
45890:68260c444fd3 45891:da178b816812
   263     """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
   263     """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
   264 
   264 
   265     def __init__(self, message, location=None, hint=None):
   265     def __init__(self, message, location=None, hint=None):
   266         super(ParseError, self).__init__(message, hint=hint)
   266         super(ParseError, self).__init__(message, hint=hint)
   267         self.location = location
   267         self.location = location
   268         # Pass the message and possibly location into the Exception constructor
       
   269         # to help code that looks for exc.args.
       
   270         if location is not None:
       
   271             Exception.__init__(self, message, location)
       
   272         else:
       
   273             Exception.__init__(self, message)
       
   274 
   268 
   275     def format(self):
   269     def format(self):
   276         from .i18n import _
   270         from .i18n import _
   277 
   271 
   278         if self.location is not None:
   272         if self.location is not None: