changeset 31424 | 4acc49335a6e |
parent 31400 | fb1f70331ee6 |
child 31425 | 63a39d647888 |
--- a/mercurial/pycompat.py Wed Mar 15 19:26:20 2017 -0700 +++ b/mercurial/pycompat.py Wed Mar 15 09:30:50 2017 -0700 @@ -38,6 +38,7 @@ import builtins import functools import io + import struct fsencode = os.fsencode fsdecode = os.fsdecode @@ -73,8 +74,7 @@ if getattr(sys, 'argv', None) is not None: sysargv = list(map(os.fsencode, sys.argv)) - def bytechr(i): - return bytes([i]) + bytechr = struct.Struct('>B').pack def iterbytestr(s): """Iterate bytes as if it were a str object of Python 2"""