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):
|
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(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user