mercurial/pycompat.py
changeset 31425 63a39d647888
parent 31424 4acc49335a6e
child 31439 b70407bd84d5
equal deleted inserted replaced
31424:4acc49335a6e 31425:63a39d647888
    76 
    76 
    77     bytechr = struct.Struct('>B').pack
    77     bytechr = struct.Struct('>B').pack
    78 
    78 
    79     def iterbytestr(s):
    79     def iterbytestr(s):
    80         """Iterate bytes as if it were a str object of Python 2"""
    80         """Iterate bytes as if it were a str object of Python 2"""
    81         return iter(s[i:i + 1] for i in range(len(s)))
    81         return map(bytechr, s)
    82 
    82 
    83     def sysstr(s):
    83     def sysstr(s):
    84         """Return a keyword str to be passed to Python functions such as
    84         """Return a keyword str to be passed to Python functions such as
    85         getattr() and str.encode()
    85         getattr() and str.encode()
    86 
    86