diff -r ae79611e3115 -r 8655a77dce94 mercurial/parser.py --- a/mercurial/parser.py Mon Sep 20 10:46:35 2021 -0400 +++ b/mercurial/parser.py Mon Sep 20 10:59:26 2021 -0400 @@ -21,7 +21,6 @@ from .i18n import _ from . import ( error, - pycompat, util, ) from .utils import stringutil @@ -216,7 +215,11 @@ return stringutil.unescapestr(s) except ValueError as e: # mangle Python's exception into our format - raise error.ParseError(pycompat.bytestr(e).lower()) + # TODO: remove this suppression. For some reason, pytype 2021.09.09 + # thinks .lower() is being called on Union[ValueError, bytes]. + # pytype: disable=attribute-error + raise error.ParseError(stringutil.forcebytestr(e).lower()) + # pytype: enable=attribute-error def _prettyformat(tree, leafnodes, level, lines):