Commit 1cc7229b authored by André Anjos's avatar André Anjos 💬
Browse files

Make file readout py3 compatible

parent fc037212
......@@ -332,6 +332,12 @@ def load_requirements(f=None):
Defaults to "./requirements.txt"
"""
f = f if f is not None else open("requirements.txt", 'rt')
retval = [k.strip() for k in f]
return [k for k in retval if k and k[0] != '#']
def readlines(f):
retval = [str(k.strip()) for k in f]
return [k for k in retval if k and k[0] != '#']
if f: return readlines(f)
# otherwise, just open requirements.txt and read all contents
with open('requirements.txt', 'rt') as f:
return readlines(f)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment