Reviewed-by: Yonghong Zhu <[email protected]> 

Best Regards,
Zhu Yonghong

-----Original Message-----
From: Kinney, Michael D 
Sent: Friday, August 3, 2018 5:26 AM
To: [email protected]
Cc: Sun, Yanyan <[email protected]>; Zhu, Yonghong <[email protected]>; 
Gao, Liming <[email protected]>; Kinney, Michael D 
<[email protected]>
Subject: [Patch] 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 <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
---
 BaseTools/Scripts/BinToPcd.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py 
index 25b74f6004..1495a36933 100644
--- a/BaseTools/Scripts/BinToPcd.py
+++ b/BaseTools/Scripts/BinToPcd.py
@@ -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
--
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to