Mercurial > public > mercurial-scm > hg-stable
diff mercurial/error.py @ 46796:e2f7b2695ba1
merge with stable
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 18 Mar 2021 18:24:59 -0400 |
parents | 6fc57680cfd6 ae62ab82a345 |
children | d4ba4d51f85f |
line wrap: on
line diff
--- a/mercurial/error.py Tue Mar 02 00:05:22 2021 +0100 +++ b/mercurial/error.py Thu Mar 18 18:24:59 2021 -0400 @@ -18,6 +18,11 @@ # Do not import anything but pycompat here, please from . import pycompat +if pycompat.TYPE_CHECKING: + from typing import ( + Optional, + ) + def _tobytes(exc): """Byte-stringify exception in the same way as BaseException_str()""" @@ -170,6 +175,7 @@ """Raised if a command needs to print an error and exit.""" def __init__(self, message, hint=None): + # type: (bytes, Optional[bytes]) -> None self.message = message self.hint = hint # Pass the message into the Exception constructor to help extensions