summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Common/GlobalData.py
diff options
context:
space:
mode:
authorJoey Vagedes via groups.io <joeyvagedes=microsoft.com@groups.io>2023-12-06 23:27:02 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-21 03:33:31 +0300
commit9f0061a03b61d282fbc0ba5be22155d06a5e64a1 (patch)
tree18a4fe05d2d43b7762bc70842790bacd3a3296ec /BaseTools/Source/Python/Common/GlobalData.py
parent89705ad6c6342e3bd635bed89608e25f74372600 (diff)
downloadedk2-9f0061a03b61d282fbc0ba5be22155d06a5e64a1.tar.xz
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 <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/GlobalData.py')
-rwxr-xr-xBaseTools/Source/Python/Common/GlobalData.py4
1 files changed, 2 insertions, 2 deletions
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))