From 0d773d7c500a1f4c4fce9f8b5e9cbb6f5cf407a9 Mon Sep 17 00:00:00 2001 From: Antaeus Kleinert-Strand Date: Thu, 26 Oct 2023 10:53:31 -0700 Subject: [PATCH] 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: