# HG changeset patch # User Matt Harbison # Date 1679638932 14400 # Node ID 3dbc7b1ecaba409c5ae417742184920f7f5fff09 # Parent 1b3aa9762d3a65e00b5829b3f185c3379805a9e8 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. diff -r 1b3aa9762d3a -r 3dbc7b1ecaba mercurial/error.py --- 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__()