diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -154,7 +154,7 @@ bytechr = struct.Struct('>B').pack byterepr = b'%r'.__mod__ - class bytestr(bytes): + class _bytestr(bytes): """A bytes which mostly acts as a Python 2 str >>> bytestr(), bytestr(bytearray(b'foo')), bytestr(u'ascii'), bytestr(1) @@ -291,6 +291,8 @@ return w + bytestr = _bytestr # type: Callable[[Union[bytes, str], bytestr] + # these wrappers are automagically imported by hgloader delattr = _wrapattrfunc(builtins.delattr) getattr = _wrapattrfunc(builtins.getattr) @@ -398,7 +400,7 @@ unicode = unicode bytechr = chr byterepr = repr - bytestr = str + bytestr = str # type: Callable[[Union[bytes, str], bytestr] iterbytestr = iter maybebytestr = identity sysbytes = identity