Skip to content

Commit

Permalink
BinToPcd.py: Update regex strings to use raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
antklein committed Oct 26, 2023
1 parent 6f4fd15 commit 0d773d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions BaseTools/Scripts/BinToPcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <PcdTokenSpaceGuidCName>.<PcdCName>'.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:
Expand Down

0 comments on commit 0d773d7

Please sign in to comment.