diff --git a/build/run_tests.py b/build/run_tests.py index fcd346f9e..a85e93891 100755 --- a/build/run_tests.py +++ b/build/run_tests.py @@ -79,7 +79,7 @@ def _BinaryDirTargetOS(binary_dir): text=True) value = popen.communicate()[0] if popen.returncode == 0: - match = re.match('target_os = "(.*)"$', value) + match = re.match(r'target_os = "(.*)"$', value) if match: return match.group(1) @@ -89,7 +89,7 @@ def _BinaryDirTargetOS(binary_dir): if os.path.exists(build_ninja_path): with open(build_ninja_path) as build_ninja_file: 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) if match: return 'android' @@ -197,7 +197,7 @@ def _adb_shell(command_args, env={}): stdout=subprocess.PIPE, text=True) - FINAL_LINE_RE = re.compile('status=(\d+)$') + FINAL_LINE_RE = re.compile(r'status=(\d+)$') final_line = None while True: # Use readline so that the test output appears “live” when running. @@ -438,7 +438,7 @@ def main(args): for line in adb_devices.splitlines(): line = line if (line == 'List of devices attached' or - re.match('^\* daemon .+ \*$', line) or line == ''): + re.match(r'^\* daemon .+ \*$', line) or line == ''): continue (device, ignore) = line.split('\t') devices.append(device)