mercurial/util.py
changeset 10756 cb681cc59a8d
parent 10487 7a6b5f85c3ab
child 10790 ef3668450cd0
equal deleted inserted replaced
10752:53313405b54d 10756:cb681cc59a8d
    33     except ImportError:
    33     except ImportError:
    34         from sha import sha as _sha1
    34         from sha import sha as _sha1
    35     global _fastsha1, sha1
    35     global _fastsha1, sha1
    36     _fastsha1 = sha1 = _sha1
    36     _fastsha1 = sha1 = _sha1
    37     return _sha1(s)
    37     return _sha1(s)
       
    38 
       
    39 import __builtin__
       
    40 
       
    41 def fakebuffer(sliceable, offset=0):
       
    42     return sliceable[offset:]
       
    43 if not hasattr(__builtin__, 'buffer'):
       
    44     __builtin__.buffer = fakebuffer
    38 
    45 
    39 import subprocess
    46 import subprocess
    40 closefds = os.name == 'posix'
    47 closefds = os.name == 'posix'
    41 
    48 
    42 def popen2(cmd, env=None, newlines=False):
    49 def popen2(cmd, env=None, newlines=False):