mercurial/testing/__init__.py
changeset 46985 52cee44aa1a0
parent 46984 99c629101b73
child 47493 2dac94edd98d
equal deleted inserted replaced
46984:99c629101b73 46985:52cee44aa1a0
    26     start = time.time()
    26     start = time.time()
    27     while not os.path.exists(path):
    27     while not os.path.exists(path):
    28         if time.time() - start > timeout:
    28         if time.time() - start > timeout:
    29             raise RuntimeError(b"timed out waiting for file: %s" % path)
    29             raise RuntimeError(b"timed out waiting for file: %s" % path)
    30         time.sleep(0.01)
    30         time.sleep(0.01)
       
    31 
       
    32 
       
    33 def write_file(path, content=b''):
       
    34     with open(path, 'wb') as f:
       
    35         f.write(content)