def update_version():
    """Update the _version.py file."""
    fname = os.path.join('.', 'lib', 'testmill', '_version.py')
    try:
        with open(fname) as fin:
            current = fin.read()
    except __HOLE__:
        current = None
    new = textwrap.dedent("""\
            # This file is autogenerated. Do not edit.
            version = '{0[version]}'
            version_string = 'Ravello TestMill {0[version]}'
            """.format(version_info))
    if current == new:
        return
    tmpname = '{0}.{1}-tmp'.format(fname, os.getpid())
    with open(tmpname, 'w') as fout:
        fout.write(new)
    os.rename(tmpname, fname)
    print('Updated _version.py')
dataset/ETHPy150Open ravello/testmill/setup.py/update_version