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