Reviewed-by: Yonghong Zhu <yonghong....@intel.com> 

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Kinney, Michael D 
Sent: Wednesday, August 01, 2018 12:29 AM
To: edk2-devel@lists.01.org
Cc: Sun, Yanyan <yanyan....@intel.com>; Zhu, Yonghong <yonghong....@intel.com>; 
Gao, Liming <liming....@intel.com>; Kinney, Michael D 
<michael.d.kin...@intel.com>
Subject: [Patch] 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 <yanyan....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>
Cc: Liming Gao <liming....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
---
 BaseTools/Scripts/BinToPcd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
         #
--
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to