

def write_version_py(filename='libtiff/version.py'):
    cnt = '\n# THIS FILE IS GENERATED FROM libtiff/setup.py\nshort_version=\'%(version)s\'\nversion=\'%(version)s\'\nrelease=%(isrelease)s\n\nif not release:\n    version += \'.dev\'\n    import os\n    svn_version_file = os.path.join(os.path.dirname(__file__),\n                                   \'__svn_version__.py\')\n    svn_entries_file = os.path.join(os.path.dirname(__file__),\'.svn\',\n                                   \'entries\')\n    if os.path.isfile(svn_version_file):\n        import imp\n        svn = imp.load_module(\'libtiff.__svn_version__\',\n                              open(svn_version_file),\n                              svn_version_file,\n                              (\'.py\',\'U\',1))\n        version += svn.version\n    elif os.path.isfile(svn_entries_file):\n        import subprocess\n        try:\n            svn_version = subprocess.Popen(["svnversion", os.path.dirname (__file__)], stdout=subprocess.PIPE).communicate()[0]\n        except:\n            pass\n        else:\n            version += svn_version.strip()\n\nprint version\n'
    a = open(filename, 'w')
    try:
        a.write((filename % {
            'version': VERSION,
            'isrelease': str(ISRELEASED),
        }))
    finally:
        a.close()

dataset/ETHPy150Open pearu/pylibtiff/setup.py write_version_py/VarMisuse@34/391 `cnt`->`filename`