Mercurial > hg
changeset 50329:3dbc7b1ecaba stable
typing: correct the signature of error.CommandError
There's a place in `mercurial.dispatch._parse()` that passes None if a parse
error happens before the command can be parsed out, and casting the error to
bytes works fine because the command and message fields are apparently ignored.
Likewise, TortoiseHg similarly passes None for the same reason.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 24 Mar 2023 02:22:12 -0400 |
parents | 1b3aa9762d3a |
children | eb07591825fa |
files | mercurial/error.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/error.py Fri Mar 24 00:11:38 2023 +0100 +++ b/mercurial/error.py Fri Mar 24 02:22:12 2023 -0400 @@ -155,7 +155,7 @@ """Exception raised on errors in parsing the command line.""" def __init__(self, command, message): - # type: (bytes, bytes) -> None + # type: (Optional[bytes], bytes) -> None self.command = command self.message = message super(CommandError, self).__init__()