]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/StrGather.py
BaseTools: Handle the bytes and str difference
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / StrGather.py
index d87680b2e7584fe2ecc9dcc288e3ad09b8814610..680ec16bd4ea75f945234c0a4d74e6cb93c9f7ea 100644 (file)
@@ -123,7 +123,10 @@ def DecToHexList(Dec, Digit = 8):
 # @retval:       A list for formatted hex string\r
 #\r
 def AscToHexList(Ascii):\r
-    return ['0x{0:02X}'.format(ord(Item)) for Item in Ascii]\r
+    try:\r
+        return ['0x{0:02X}'.format(Item) for Item in Ascii]\r
+    except:\r
+        return ['0x{0:02X}'.format(ord(Item)) for Item in Ascii]\r
 \r
 ## Create content of .h file\r
 #\r