setup: Explicitly close file
Instead of relying on GC.
This commit is contained in:
parent
9129955592
commit
f361109832
6
setup.py
6
setup.py
@ -6,9 +6,9 @@ from setuptools import find_packages, setup
|
||||
|
||||
|
||||
def get_version(filename):
|
||||
init_py = open(filename).read()
|
||||
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
|
||||
return metadata['version']
|
||||
with open(filename) as fh:
|
||||
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
|
||||
return metadata['version']
|
||||
|
||||
|
||||
setup(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user