From 81272b732c04425da866eb85fd590f6ab3b5d49d Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Fri, 4 Apr 2025 02:57:32 +0200 Subject: [PATCH] Silence Python invalid escape sequence warnings by turning some strings into raw strings --- SConstruct | 2 +- site_scons/site_init.py | 2 +- src/trusted/service_runtime/build.scons | 2 +- tools/command_tester.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index f1ebf0b..fa3ab7f 100755 --- a/SConstruct +++ b/SConstruct @@ -3623,7 +3623,7 @@ windows_coverage_env = windows_debug_env.Clone( # needed. MANIFEST_FILE = None, COVERAGE_ANALYZER_DIR=r'..\third_party\coverage_analyzer\bin', - COVERAGE_ANALYZER='$COVERAGE_ANALYZER_DIR\coverage_analyzer.exe', + COVERAGE_ANALYZER=r'$COVERAGE_ANALYZER_DIR\coverage_analyzer.exe', ) # TODO(bradnelson): Switch nacl to common testing process so this won't be # needed. Ignoring instrumentation failure as that's easier diff --git a/site_scons/site_init.py b/site_scons/site_init.py index 75526cc..98f91a1 100755 --- a/site_scons/site_init.py +++ b/site_scons/site_init.py @@ -129,7 +129,7 @@ def BuildEnvironmentSConscripts(env): else: raise SCons.Errors.UserError( 'Bad location for a SConscript. "%s" is not under ' - '\$TARGET_ROOT or \$MAIN_DIR' % c_script) + r'\$TARGET_ROOT or \$MAIN_DIR' % c_script) def UsingNaclMode(): build_modes = SCons.Script.ARGUMENTS.get('MODE') or SCons.Script.GetOption('build_mode') diff --git a/src/trusted/service_runtime/build.scons b/src/trusted/service_runtime/build.scons index 3a0d9db..33aa2e0 100644 --- a/src/trusted/service_runtime/build.scons +++ b/src/trusted/service_runtime/build.scons @@ -824,7 +824,7 @@ if env.Bit('build_x86_64'): if env.Bit('build_x86') and env.Bit('nacl_static_link'): RE_HELLO = '^(Hello, World!)$' - RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' + RE_IDENT = r'^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' node = env.CommandSelLdrTestNacl( 'nacl_log.out', diff --git a/tools/command_tester.py b/tools/command_tester.py index d5a291f..8dac260 100755 --- a/tools/command_tester.py +++ b/tools/command_tester.py @@ -356,7 +356,7 @@ def GetNaClSignalInfoFromStderr(stderr): # Scan for signal msg in reverse order for curline in reversed(lines): - match = re.match('\*\* (Signal|Mach exception) (\d+) from ' + match = re.match(r'\*\* (Signal|Mach exception) (\d+) from ' '(trusted|untrusted) code', str(curline)) if match is not None: return match.group(0)