mercurial/pycompat.py
changeset 31253 64596338ba10
parent 31149 76a64c1e5439
child 31301 295625f1296b
--- a/mercurial/pycompat.py	Thu Mar 02 13:34:01 2017 +0100
+++ b/mercurial/pycompat.py	Wed Mar 08 22:30:12 2017 +0900
@@ -71,6 +71,9 @@
     # workaround to simulate the Python 2 (i.e. ANSI Win32 API) behavior.
     sysargv = list(map(os.fsencode, sys.argv))
 
+    def bytechr(i):
+        return bytes([i])
+
     def sysstr(s):
         """Return a keyword str to be passed to Python functions such as
         getattr() and str.encode()
@@ -134,6 +137,8 @@
         return [a.encode('latin-1') for a in ret]
 
 else:
+    bytechr = chr
+
     def sysstr(s):
         return s