From 9f0061a03b61d282fbc0ba5be22155d06a5e64a1 Mon Sep 17 00:00:00 2001 From: "Joey Vagedes via groups.io" Date: Wed, 6 Dec 2023 12:27:02 -0800 Subject: BaseTools: Resolve regex syntax warnings Switches regex patterns to raw text to resolve python 3.12 syntax warnings in regards to invalid escape sequences, as is suggested by the re (regex) module in python. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Signed-off-by: Joey Vagedes Reviewed-by: Rebecca Cran --- BaseTools/Source/Python/Common/GlobalData.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/Common/GlobalData.py') diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 197bd83666..11849e863f 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -33,10 +33,10 @@ gDefaultStores = [] gGuidDict = {} # definition for a MACRO name. used to create regular expressions below. -_MacroNamePattern = "[A-Z][A-Z0-9_]*" +_MacroNamePattern = r"[A-Z][A-Z0-9_]*" ## Regular expression for matching macro used in DSC/DEC/INF file inclusion -gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE) +gMacroRefPattern = re.compile(r"\$\(({})\)".format(_MacroNamePattern), re.UNICODE) gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+") gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern)) -- cgit v1.2.3