texlive[73541] Build/source/texk/web2c/tests/fix-changefile-lines.py:

commits+ascherer at tug.org commits+ascherer at tug.org
Tue Jan 21 16:47:36 CET 2025


Revision: 73541
          https://tug.org/svn/texlive?view=revision&revision=73541
Author:   ascherer
Date:     2025-01-21 16:47:36 +0100 (Tue, 21 Jan 2025)
Log Message:
-----------
Avoid deprecation warning.

Python 3.13.1 on macOS started to issue a Deprecation Warning re
parameter 'count' that was passed as a positional argument. Instead,
upcoming Python versions expect to see named parameters 'count' and
'flags' for 're.sub()'.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py

Modified: trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py
===================================================================
--- trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py	2025-01-21 15:14:18 UTC (rev 73540)
+++ trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py	2025-01-21 15:47:36 UTC (rev 73541)
@@ -171,11 +171,14 @@
             new_line = self._lines[self._chunk_start]
 
             new_line = re.sub(
-                    "\\[\\d+\\.\\d+\\]", f"[{part}.{section}]", new_line, 1)
+                    "\\[\\d+\\.\\d+\\]", f"[{part}.{section}]",
+                    new_line, count=1)
             new_line = re.sub(
-                    "^@x \\[\\d+\\]", f"@x [{section}]", new_line, 1)
+                    "^@x \\[\\d+\\]", f"@x [{section}]",
+                    new_line, count=1)
             new_line = re.sub(
-                    "l\\.\\d+", f"l.{line_number}", new_line, 1)
+                    "l\\.\\d+", f"l.{line_number}",
+                    new_line, count=1)
 
             # Force '[part.section] l.line' tag after '@x'; useful for untagged
             # change files, e.g., CWEB's '*-w2c.ch' monsters.
@@ -182,7 +185,7 @@
             if opt_handler.init_b:
                 new_line = re.sub(
                         "^@x", f"@x [{part}.{section}] l.{line_number}",
-                        new_line, 1)
+                        new_line, count=1)
 
             ch_line = self._lines[self._chunk_start]
             if new_line[:10] != ch_line[:10]:



More information about the tex-live-commits mailing list.