mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-17 21:36:00 +00:00
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.
This commit is contained in:
parent
b319b31e6c
commit
08a747a750
@ -562,15 +562,15 @@ def convert(lines, end_format):
|
|||||||
match = re_Format.match(lines[i])
|
match = re_Format.match(lines[i])
|
||||||
if match:
|
if match:
|
||||||
formatline = i
|
formatline = i
|
||||||
format_ = int(match.group(4))
|
format = int(match.group(4))
|
||||||
if 1 < format_ < end_format:
|
if 1 < format < end_format:
|
||||||
lines[i] = b"Format %d" % (format_ + 1)
|
lines[i] = b"Format %d" % (format + 1)
|
||||||
only_comment = 0
|
only_comment = 0
|
||||||
elif format_ == end_format:
|
elif format == end_format:
|
||||||
# nothing to do
|
# nothing to do
|
||||||
return format_
|
return format
|
||||||
else:
|
else:
|
||||||
error(f'Cannot convert file format {format_} to {end_format}')
|
error(f'Cannot convert file format {format} to {end_format}')
|
||||||
else:
|
else:
|
||||||
lines.insert(i, b"Format 2")
|
lines.insert(i, b"Format 2")
|
||||||
only_comment = 0
|
only_comment = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user