Add final newline check for requirements
Ensure that every line has a newline; particularly the last one. Change-Id: I8cfa194461946fb78dc9ea0aa51cf6158d5bb81c
This commit is contained in:
parent
9f06bccfb8
commit
9d2d2455a8
@ -43,6 +43,9 @@ class RequirementsList(object):
|
|||||||
if not os.path.exists(fn):
|
if not os.path.exists(fn):
|
||||||
return
|
return
|
||||||
for line in open(fn):
|
for line in open(fn):
|
||||||
|
if '\n' not in line:
|
||||||
|
raise Exception("Requirements file %s does not "
|
||||||
|
"end with a newline." % fn)
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
line = line[:line.find('#')]
|
line = line[:line.find('#')]
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user