Skip to content

Commit ceed268

Browse files
e-kwsmChrisThrasher
authored andcommitted
fix(python): fix invalid escape sequences
1 parent 04cbcfa commit ceed268

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/TestScripts/DiscoverTests/VerifyRegistration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
TestInfo = namedtuple('TestInfo', ['name', 'tags'])
1919

20-
cmake_version_regex = re.compile('cmake version (\d+)\.(\d+)\.(\d+)')
20+
cmake_version_regex = re.compile(r'cmake version (\d+)\.(\d+)\.(\d+)')
2121

2222
def get_cmake_version():
2323
result = subprocess.run(['cmake', '--version'],

tools/scripts/approvalTests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def filterLine(line, isCompact):
121121
# strip source line numbers
122122
# Note that this parser assumes an already normalized filepath from above,
123123
# and might break terribly if it is moved around before the normalization.
124-
line = filelocParser.sub('\g<filename>:<line number>', line)
124+
line = filelocParser.sub(r'\g<filename>:<line number>', line)
125125

126126
line = lineNumberParser.sub(" ", line)
127127

@@ -130,7 +130,7 @@ def filterLine(line, isCompact):
130130
line = line.replace(': PASSED', ': passed')
131131

132132
# strip out the test order number in TAP to avoid massive diffs for every change
133-
line = tapTestNumParser.sub("\g<1> {test-number} -", line)
133+
line = tapTestNumParser.sub(r"\g<1> {test-number} -", line)
134134

135135
# strip Catch2 version number
136136
line = versionParser.sub("<version>", line)
@@ -148,7 +148,7 @@ def filterLine(line, isCompact):
148148
line = junitDurationsParser.sub(' time="{duration}"', line)
149149
line = durationParser.sub(' duration="{duration}"', line)
150150
line = timestampsParser.sub('{iso8601-timestamp}', line)
151-
line = specialCaseParser.sub('file:\g<1>', line)
151+
line = specialCaseParser.sub(r'file:\g<1>', line)
152152
line = sinceEpochParser.sub('{since-epoch-report}', line)
153153
return line
154154

tools/scripts/checkConvenienceHeaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
import re
2222

2323
def normalized_path(path):
24-
"""Replaces \ in paths on Windows with /"""
24+
r"""Replaces \ in paths on Windows with /"""
2525
return path.replace('\\', '/')
2626

2727
def normalized_paths(paths):
28-
"""Replaces \ with / in every path"""
28+
r"""Replaces \ with / in every path"""
2929
return [normalized_path(path) for path in paths]
3030

3131
source_path = catchPath + '/src/catch2'

0 commit comments

Comments
 (0)