mercurial/util.py
changeset 36791 30742c216abb
parent 36783 1fbbb8e83392
child 36793 eca1051e6c22
equal deleted inserted replaced
36790:cb0afaf112e8 36791:30742c216abb
   209     """
   209     """
   210     if f is pycompat.identity:
   210     if f is pycompat.identity:
   211         # fast path mainly for py2
   211         # fast path mainly for py2
   212         return xs
   212         return xs
   213     return _rapply(f, xs)
   213     return _rapply(f, xs)
   214 
       
   215 def bytesinput(fin, fout, *args, **kwargs):
       
   216     sin, sout = sys.stdin, sys.stdout
       
   217     try:
       
   218         sys.stdin, sys.stdout = encoding.strio(fin), encoding.strio(fout)
       
   219         return encoding.strtolocal(pycompat.rawinput(*args, **kwargs))
       
   220     finally:
       
   221         sys.stdin, sys.stdout = sin, sout
       
   222 
   214 
   223 def bitsfrom(container):
   215 def bitsfrom(container):
   224     bits = 0
   216     bits = 0
   225     for bit in container:
   217     for bit in container:
   226         bits |= bit
   218         bits |= bit