setup: Explicitly close file

Instead of relying on GC.
This commit is contained in:
Stein Magnus Jodal 2015-03-22 09:23:07 +01:00
parent 9129955592
commit f361109832

View File

@ -6,9 +6,9 @@ from setuptools import find_packages, setup
def get_version(filename): def get_version(filename):
init_py = open(filename).read() with open(filename) as fh:
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py)) metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
return metadata['version'] return metadata['version']
setup( setup(