Commit 574a301e authored by Ad Schellevis's avatar Ad Schellevis

(config/template) prevent empty template result from failing.

parent 5b39c0a4
...@@ -245,7 +245,7 @@ class Template(object): ...@@ -245,7 +245,7 @@ class Template(object):
# Check if the last character of our output contains an end-of-line, if not copy it in if # Check if the last character of our output contains an end-of-line, if not copy it in if
# it was in the original template. # it was in the original template.
# It looks like Jinja sometimes isn't consistent on placing this last end-of-line in. # It looks like Jinja sometimes isn't consistent on placing this last end-of-line in.
if content[-1] != '\n': if len(content) > 1 and content[-1] != '\n':
src_file = '%s%s'%(self._template_dir,template_filename) src_file = '%s%s'%(self._template_dir,template_filename)
src_file_handle = open(src_file,'r') src_file_handle = open(src_file,'r')
src_file_handle.seek(-1, os.SEEK_END) src_file_handle.seek(-1, os.SEEK_END)
......
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