From 454598b928e5d1aea549158d5a0f2904df7e452c Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Mon, 12 Sep 2011 20:42:22 +0000 Subject: [PATCH] * layout2layout.py : Don't choke on empty input file. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39665 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/layout2layout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index a59dfcfae2..66caa57ece 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -152,7 +152,7 @@ def trim_bom(line): def read(source): " Read input file and strip lineendings." - lines = source.read().splitlines() + lines = source.read().splitlines() or [''] lines[0] = trim_bom(lines[0]) return lines @@ -753,6 +753,8 @@ def convert(lines): i += 1 + if only_comment: + lines.insert(i, "Format 2") if usemodules: i = formatline + 1 for mod in usemodules: -- 2.39.5