mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
BaseTools/BinToPcd: Encode string returned from ByteArray()
https://bugzilla.tianocore.org/show_bug.cgi?id=1069 The ByteArray() method returns a string with the hex bytes of a PCD value. Make sure the string is always encoded as a string, so it can be used to build a complete PCD statement string and be written out to a file. This change is required for Python 3.x compatibility. 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:
parent
7191827f90
commit
83964ebc5e
@ -70,7 +70,8 @@ if __name__ == '__main__':
|
||||
#
|
||||
# Return a PCD value of the form '{0x01, 0x02, ...}' along with the PCD length in bytes
|
||||
#
|
||||
return '{' + (', '.join (['0x{Byte:02X}'.format (Byte = Item) for Item in Buffer])) + '}', len (Buffer)
|
||||
PcdValue = '{' + ', '.join (['0x{Byte:02X}'.format (Byte = Item) for Item in Buffer]) + '}'
|
||||
return PcdValue.encode (), len (Buffer)
|
||||
|
||||
#
|
||||
# Create command line argument parser object
|
||||
|
Loading…
x
Reference in New Issue
Block a user