Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/error.py @ 45906:da178b816812
errors: remove ParseError.args
With the previous few patches, it is no longer needed (as far as the
test suite can tell anyway).
Differential Revision: https://phab.mercurial-scm.org/D9354
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 20 Nov 2020 10:34:26 -0800 |
parents | 68260c444fd3 |
children | 9dc1351d0b5f |
comparison
equal
deleted
inserted
replaced
45905:68260c444fd3 | 45906: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: |