From: Kinney, Michael D Date: Tue, 31 Jul 2018 16:24:20 +0000 (-0700) Subject: BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue X-Git-Tag: edk2-stable201903~1306 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=76c09700edc67686b29662e81a3ca7d947594ce5;ds=sidebyside BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue https://bugzilla.tianocore.org/show_bug.cgi?id=1042 Convert Buffer to type bytearray before converting to a string of hex byte values so the type of items in Buffer is consistent for both Python 2.7.x and Python 3.x. Cc: YanYan Sun Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index c42e37bd11..25b74f6004 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -66,7 +66,7 @@ if __name__ == '__main__': # # If Xdr flag is not set, then concatenate all the data # - Buffer = b''.join (Buffer) + Buffer = bytearray (b''.join (Buffer)) # # Return a PCD value of the form '{0x01, 0x02, ...}' along with the PCD length in bytes #