From 7400f85b89edbe6ead683bf2e5c4e7439d6ea8d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Wed, 6 Jul 2005 19:03:15 +0000 Subject: [PATCH] Consider the case where there is not any layout name. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10143 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/ChangeLog | 5 +++++ lib/lyx2lyx/lyx_1_1_5.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 339adb9f9b..6e0e7fcf68 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,8 @@ +2005-07-06 José Matos + + * lyx_1_1_5.py (replace_protected_separator): Make it robust + to layout name absence. + 2005-07-06 José Matos * LyX.py (read): Add support for cases where the body begins diff --git a/lib/lyx2lyx/lyx_1_1_5.py b/lib/lyx2lyx/lyx_1_1_5.py index 4f533a9c6d..00b84d2a3f 100644 --- a/lib/lyx2lyx/lyx_1_1_5.py +++ b/lib/lyx2lyx/lyx_1_1_5.py @@ -33,7 +33,11 @@ def replace_protected_separator(file): break j = find_token_backwards(lines, "\\layout", i) #if j == -1: print error - layout = layout_exp.match(lines[j]).group(1) + layout_m = layout_exp.match(lines[j]) + if layout_m: + layout = layout_m.group(1) + else: + layout = "Standard" if layout == "LyX-Code": result = "" -- 2.39.5