Skip to content

Commit 43b5533

Browse files
author
C. Michael Pilato
committed
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. git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1932974 13f79535-47bb-0310-9956-ffa450edef68
1 parent 767da28 commit 43b5533

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tools/dev/contribulyze.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,15 @@ def __str__(self):
517517

518518
log_separator = '-' * 72 + '\n'
519519
log_header_re = re.compile\
520-
('^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
520+
(r'^(r[0-9]+) \| ([^|]+) \| ([^|]+) \| ([0-9]+)[^0-9]')
521521
field_re = re.compile(
522-
'^(Patch|Review(ed)?|Suggested|Found|Inspired|Tested|Reported) by:'
523-
'\s*\S.*$')
522+
r'^(Patch|Review(ed)?|Suggested|Found|Inspired|Tested|Reported) by:'
523+
r'\s*\S.*$')
524524
field_aliases = {
525525
'Reviewed' : 'Review',
526526
'Reported' : 'Found',
527527
}
528-
parenthetical_aside_re = re.compile('^\s*\(.*\)\s*$')
528+
parenthetical_aside_re = re.compile(r'^\s*\(.*\)\s*$')
529529

530530
def graze(input):
531531
just_saw_separator = False
@@ -576,7 +576,7 @@ def graze(input):
576576
# Each line begins either with "WORD by:", or with whitespace.
577577
in_field_re = re.compile('^('
578578
+ (field.alias or field.name)
579-
+ ' by:\s+|\s+)([^\s(].*)')
579+
+ r' by:\s+|\s+)([^\s(].*)')
580580
m = in_field_re.match(line)
581581
if m is None:
582582
sys.stderr.write("Error matching: %s\n" % (line))
@@ -703,7 +703,7 @@ def process_committers(committers):
703703
while line != 'Blanket commit access:\n':
704704
line = committers.readline()
705705
in_full_committers = True
706-
matcher = re.compile('(\S+)\s+([^\(\)]+)\s+(\([^()]+\)){0,1}')
706+
matcher = re.compile(r'(\S+)\s+([^\(\)]+)\s+(\([^()]+\)){0,1}')
707707
line = committers.readline()
708708
while line:
709709
# Every @-sign we see after this point indicates a committer line...

0 commit comments

Comments
 (0)