mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:16:13 +00:00
Fix SyntaxWarning in build/run_tests.py
Use r-strings for all regular expressions. Fixes these warnings experienced with Python 3.12 (https://github.com/python/cpython/issues/98401, https://github.com/python/cpython/pull/99011, https://docs.python.org/3/whatsnew/3.12.html#other-language-changes point 2): run_tests.py:200: SyntaxWarning: invalid escape sequence '\d' FINAL_LINE_RE = re.compile('status=(\d+)$') run_tests.py:441: SyntaxWarning: invalid escape sequence '\*' re.match('^\* daemon .+ \*$', line) or line == ''): Change-Id: I71ddfb1a2ca62654378ae67a99e9aeb4ce7b7394 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6254063 Commit-Queue: Mark Mentovai <mark@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org>
This commit is contained in:
parent
4a227b2d7c
commit
85ecbd2a77
@ -79,7 +79,7 @@ def _BinaryDirTargetOS(binary_dir):
|
|||||||
text=True)
|
text=True)
|
||||||
value = popen.communicate()[0]
|
value = popen.communicate()[0]
|
||||||
if popen.returncode == 0:
|
if popen.returncode == 0:
|
||||||
match = re.match('target_os = "(.*)"$', value)
|
match = re.match(r'target_os = "(.*)"$', value)
|
||||||
if match:
|
if match:
|
||||||
return match.group(1)
|
return match.group(1)
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ def _BinaryDirTargetOS(binary_dir):
|
|||||||
if os.path.exists(build_ninja_path):
|
if os.path.exists(build_ninja_path):
|
||||||
with open(build_ninja_path) as build_ninja_file:
|
with open(build_ninja_path) as build_ninja_file:
|
||||||
build_ninja_content = build_ninja_file.read()
|
build_ninja_content = build_ninja_file.read()
|
||||||
match = re.search('-linux-android(eabi)?-ar$', build_ninja_content,
|
match = re.search(r'-linux-android(eabi)?-ar$', build_ninja_content,
|
||||||
re.MULTILINE)
|
re.MULTILINE)
|
||||||
if match:
|
if match:
|
||||||
return 'android'
|
return 'android'
|
||||||
@ -197,7 +197,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
text=True)
|
text=True)
|
||||||
|
|
||||||
FINAL_LINE_RE = re.compile('status=(\d+)$')
|
FINAL_LINE_RE = re.compile(r'status=(\d+)$')
|
||||||
final_line = None
|
final_line = None
|
||||||
while True:
|
while True:
|
||||||
# Use readline so that the test output appears “live” when running.
|
# Use readline so that the test output appears “live” when running.
|
||||||
@ -438,7 +438,7 @@ def main(args):
|
|||||||
for line in adb_devices.splitlines():
|
for line in adb_devices.splitlines():
|
||||||
line = line
|
line = line
|
||||||
if (line == 'List of devices attached' or
|
if (line == 'List of devices attached' or
|
||||||
re.match('^\* daemon .+ \*$', line) or line == ''):
|
re.match(r'^\* daemon .+ \*$', line) or line == ''):
|
||||||
continue
|
continue
|
||||||
(device, ignore) = line.split('\t')
|
(device, ignore) = line.split('\t')
|
||||||
devices.append(device)
|
devices.append(device)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user