From d943b0c339fe3d35ffdf9f580ccb7a55915c6854 Mon Sep 17 00:00:00 2001 From: "Feng, Bob C" Date: Wed, 23 Jan 2019 10:16:00 +0800 Subject: BaseTools: Handle the bytes and str difference Deal with bytes and str is different, remove the unicode(), correct open file parameter. Using utcfromtimestamp instead of fromtimestamp. Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Tested-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/Python/GenFds/Region.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/Region.py') diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py index 83363276d2..972847efae 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -62,8 +62,8 @@ class Region(object): PadByte = pack('B', 0xFF) else: PadByte = pack('B', 0) - PadData = ''.join(PadByte for i in range(0, Size)) - Buffer.write(PadData) + for i in range(0, Size): + Buffer.write(PadByte) ## AddToBuffer() # @@ -131,7 +131,7 @@ class Region(object): if self.FvAddress % FvAlignValue != 0: EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT %s Aligned!" % (FvObj.UiFvName, FvObj.FvAlignment)) - FvBuffer = BytesIO('') + FvBuffer = BytesIO() FvBaseAddress = '0x%X' % self.FvAddress BlockSize = None BlockNum = None -- cgit v1.2.3