From 0d773d7c500a1f4c4fce9f8b5e9cbb6f5cf407a9 Mon Sep 17 00:00:00 2001 From: Antaeus Kleinert-Strand Date: Thu, 26 Oct 2023 10:53:31 -0700 Subject: [PATCH 1/2] BinToPcd.py: Update regex strings to use raw strings --- BaseTools/Scripts/BinToPcd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index 0955974dfd..43fc458b04 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -10,12 +10,12 @@ ''' from __future__ import print_function -import sys import argparse -import re import io -import struct import math +import re +import struct +import sys # # Globals for help information @@ -37,17 +37,17 @@ def ValidateUnsignedInteger (Argument): return Value def ValidatePcdName (Argument): - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: + if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not in the form .'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message) return Argument def ValidateGuidName (Argument): - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: + if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not a valid GUID C name'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message) return Argument - + def XdrPackBuffer (buffer): packed_bytes = io.BytesIO() for unpacked_bytes in buffer: From e8300a8f85c0b8edfc32e1e2419cccd33550fd95 Mon Sep 17 00:00:00 2001 From: Antaeus Kleinert-Strand Date: Thu, 26 Oct 2023 14:21:41 -0700 Subject: [PATCH 2/2] add MU_CHANGE tags --- BaseTools/Scripts/BinToPcd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index 43fc458b04..688a59e6f9 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -10,12 +10,14 @@ ''' from __future__ import print_function +# MU_CHANGE BEGIN: isort imports import argparse import io import math import re import struct import sys +# MU_CHANGE END # # Globals for help information @@ -37,12 +39,14 @@ def ValidateUnsignedInteger (Argument): return Value def ValidatePcdName (Argument): + # MU_CHANGE: make regex string a raw string if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not in the form .'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message) return Argument def ValidateGuidName (Argument): + # MU_CHANGE: make regex string a raw string if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not a valid GUID C name'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message)