svn commit: r1932974 - subversion/trunk/tools/dev

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177587097540.1592502.1496239920064295602@svn03-he-fi>
Author: cmpilato
Date: Sat Apr 11 01:29:35 2026
New Revision: 1932974

Log:
Silence some SyntaxWarnings from Python 3.12+:

    contribulyze.py:520: SyntaxWarning: invalid escape sequence '\|'
      ('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
    contribulyze.py:523: SyntaxWarning: invalid escape sequence '\s'
      '\s*\S.*$')
    contribulyze.py:528: SyntaxWarning: invalid escape sequence '\s'
      parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
    contribulyze.py:579: SyntaxWarning: invalid escape sequence '\s'
      + ' by:\s+|\s+)([^\s(].*)')
    contribulyze.py:706: SyntaxWarning: invalid escape sequence '\S'
      matcher = re.compile('(\S+)\s+([^\(\)]+)\s+(\([^()]+\)){0,1}')

* tools/dev/contribulyze.py: Use r-strings to appease the Python regex
    parser.

Modified:
   subversion/trunk/tools/dev/contribulyze.py

Modified: subversion/trunk/tools/dev/contribulyze.py
==============================================================================
--- subversion/trunk/tools/dev/contribulyze.py	Sat Apr 11 01:04:36 2026	(r1932973)
+++ subversion/trunk/tools/dev/contribulyze.py	Sat Apr 11 01:29:35 2026	(r1932974)
@@ -517,15 +517,15 @@ class LogMessage(object):
 
 log_separator = '-' * 72 + '\n'
 log_header_re = re.compile\
-                ('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
+                (r'^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
 field_re = re.compile(
-           '^(Patch|Review(ed)?|Suggested|Found|Inspired|Tested|Reported) by:'
-           '\s*\S.*$')
+           r'^(Patch|Review(ed)?|Suggested|Found|Inspired|Tested|Reported) by:'
+           r'\s*\S.*$')
 field_aliases = {
   'Reviewed' : 'Review',
   'Reported' : 'Found',
 }
-parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
+parenthetical_aside_re = re.compile(r'^\s*\(.*\)\s*$')
 
 def graze(input):
   just_saw_separator = False
@@ -576,7 +576,7 @@ def graze(input):
                 # Each line begins either with "WORD by:", or with whitespace.
                 in_field_re = re.compile('^('
                                          + (field.alias or field.name)
-                                         + ' by:\s+|\s+)([^\s(].*)')
+                                         + r' by:\s+|\s+)([^\s(].*)')
                 m = in_field_re.match(line)
                 if m is None:
                   sys.stderr.write("Error matching: %s\n" % (line))
@@ -703,7 +703,7 @@ def process_committers(committers):
   while line != 'Blanket commit access:\n':
     line = committers.readline()
   in_full_committers = True
-  matcher = re.compile('(\S+)\s+([^\(\)]+)\s+(\([^()]+\)){0,1}')
+  matcher = re.compile(r'(\S+)\s+([^\(\)]+)\s+(\([^()]+\)){0,1}')
   line = committers.readline()
   while line:
     # Every @-sign we see after this point indicates a committer line...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.