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.sun@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Kinney, Michael D 2018-07-31 09:24:20 -07:00
parent d65b78f101
commit 76c09700ed
1 changed files with 1 additions and 1 deletions

View File

@ -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
#