Skip to content
Snippets Groups Projects
Commit b3802e0f authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

setup: use context manager when reading file

parent 9fa52a42
No related branches found
No related tags found
1 merge request!78Preparations for a release
......@@ -10,10 +10,11 @@
def get_version(relpath):
root = dirname(__file__)
for line in open(join(root, relpath), 'rb'):
line = line.decode('utf-8')
if '__version__' in line:
return line.split("'")[1]
with open(join(root, relpath), 'rb') as fp:
for line in fp:
line = line.decode('utf-8')
if '__version__' in line:
return line.split("'")[1]
setup(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment