From 94b6dab410484bc30610f41afa8ce54f07ef9597 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Sat, 17 May 2025 10:18:41 +0900 Subject: [PATCH] fix(py): fix SyntaxWarning: invalid escape sequence --- build/flatten-headers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/flatten-headers.py b/build/flatten-headers.py index 563725a7e..6049fc104 100755 --- a/build/flatten-headers.py +++ b/build/flatten-headers.py @@ -110,7 +110,7 @@ def print_usage(): def canonicalize_ws( s ): - return re.sub( '\s+', ' ', s ).strip() + return re.sub( r'\s+', ' ', s ).strip() # --- @@ -166,7 +166,7 @@ def list_contains_header( items ): rval = False for item in items: - is_h = re.search( "\.h", item ) + is_h = re.search( r"\.h", item ) if is_h: rval = True @@ -198,7 +198,7 @@ def get_header_path( filename, header_dirpaths ): def strip_cstyle_comments( string ): - return re.sub( "/\*.*?\*/", "", string, flags=re.S ) + return re.sub( r"/\*.*?\*/", "", string, flags=re.S ) # ------------------------------------------------------------------------------ @@ -506,7 +506,7 @@ def main(): # Precompile the main regular expression used to isolate #include # directives and the headers they reference. This regex object will # get reused over and over again in flatten_header(). - regex = re.compile( '^[\s]*#include (["<])([\w\.\-/]*)([">])' ) + regex = re.compile( r'^[\s]*#include (["<])([\w\.\-/]*)([">])' ) # Recursively substitute headers for occurrences of #include directives. final_string = flatten_header( inputfile, header_dirpaths, nestsp )