summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2024-06-23 13:57:04 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2024-06-23 13:57:04 +0000
commitf63c10f9f691979d2bdc86fbd986789da7d2e885 (patch)
treefd79722a3f13b96685e8fd6f7c126cb654de8753 /Build/source/texk/web2c/tests
parenta567ad9d20d939a65b2469cc8bed729450b4542d (diff)
Catch another exceptional situation.
'WebReader.next_line()' will never set 'tex_line' to 'None' of its own. In the case that it reaches the end of the '_web_lines' array---say the change expects more lines after the last line in the original file---, it returns a single 'None' that gets assigned to the '(p,s,l)' triplet. However, the 'tex_line' is not changed and still holds the last matching line from an earlier 'next_line()' (either in the 'for' loop or in the 'while' loop). We assign 'tex_line = None' when catching the 'TypeError' exception, because the author of the change file might accidentally duplicate a line in the '@x..@y' part of the change hunk. git-svn-id: svn://tug.org/texlive/trunk@71597 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rwxr-xr-xBuild/source/texk/web2c/tests/fix-changefile-lines.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py
index 0ff5ca6d7d2..6a40e5127f5 100755
--- a/Build/source/texk/web2c/tests/fix-changefile-lines.py
+++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py
@@ -154,7 +154,10 @@ class ChangeReader:
sys.exit(1)
if tex_line == self._match_lines[0]:
for i in range(1, len(self._match_lines)):
- _, tex_line = web_reader.next_line()
+ try:
+ _, tex_line = web_reader.next_line()
+ except:
+ tex_line = None
if tex_line is None or tex_line != self._match_lines[i]:
eprint("ERROR: Could not match all lines following match line:")
eprint(f" {self._match_lines[0]}")