commit 08a747a75027ed09fb62e6d30983aa3b563156b9
Author: José Matos <[email protected]>
Date: Sun Jan 5 12:16:58 2025 +0000
Fix typo that make the conversion not working
The reason to change was that format is a builtin function in Python.
By redefining it we are simply overriding it and so it is not a problem
although not elegant.
Another issue in this file is `match` that become a contextual keyword
in Python 3.10. Again it is not elegant although it is allowed.
---
lib/scripts/layout2layout.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index cc3adaaa03..5db0c9e41b 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -562,15 +562,15 @@ def convert(lines, end_format):
match = re_Format.match(lines[i])
if match:
formatline = i
- format_ = int(match.group(4))
- if 1 < format_ < end_format:
- lines[i] = b"Format %d" % (format_ + 1)
+ format = int(match.group(4))
+ if 1 < format < end_format:
+ lines[i] = b"Format %d" % (format + 1)
only_comment = 0
- elif format_ == end_format:
+ elif format == end_format:
# nothing to do
- return format_
+ return format
else:
- error(f'Cannot convert file format {format_} to
{end_format}')
+ error(f'Cannot convert file format {format} to
{end_format}')
else:
lines.insert(i, b"Format 2")
only_comment = 0
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs