Commit e9e8b1d5 authored by Marco Mariani's avatar Marco Mariani

correctly handle newline and missing file

parent 67a0f7f4
......@@ -98,9 +98,9 @@ class GenericBaseRecipe(object):
line must be unicode."""
try:
lines = io.open(filepath, 'r', encoding=encoding).readlines()
except IOError:
if os.path.exists(filepath):
lines = [l.rstrip('\n') for l in io.open(filepath, 'r', encoding=encoding)]
else:
lines = []
if not line in lines:
......
Markdown is supported
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