def _stamp_version(filename):
    found, out = False, []
    f = open(filename, 'r')
    for line in f:
        if '__version__ =' in line:
            line = line.replace("'git'", "'%s'" % VERSION)
            found = True
        out.append(line)
    f.close()

    if found:
        f = open(filename, 'w')
        f.writelines(out)
        f.close()
dataset/ETHPy150Open kergoth/git-origin/git-python/setup.py/_stamp_version/original