BaseTools: replace get_bytes_le() to bytes_le
UUID does not have the get_bytes_le() in python3 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@ -1180,7 +1180,7 @@ def ParseFieldValue (Value):
|
|||||||
if Value[0] == '"' and Value[-1] == '"':
|
if Value[0] == '"' and Value[-1] == '"':
|
||||||
Value = Value[1:-1]
|
Value = Value[1:-1]
|
||||||
try:
|
try:
|
||||||
Value = "'" + uuid.UUID(Value).get_bytes_le() + "'"
|
Value = "'" + uuid.UUID(Value).bytes_le + "'"
|
||||||
except ValueError as Message:
|
except ValueError as Message:
|
||||||
raise BadExpression(Message)
|
raise BadExpression(Message)
|
||||||
Value, Size = ParseFieldValue(Value)
|
Value, Size = ParseFieldValue(Value)
|
||||||
|
@ -229,7 +229,7 @@ class CapsulePayload(CapsuleData):
|
|||||||
)
|
)
|
||||||
if AuthData:
|
if AuthData:
|
||||||
Buffer += pack('QIHH', AuthData[0], AuthData[1], AuthData[2], AuthData[3])
|
Buffer += pack('QIHH', AuthData[0], AuthData[1], AuthData[2], AuthData[3])
|
||||||
Buffer += uuid.UUID(AuthData[4]).get_bytes_le()
|
Buffer += uuid.UUID(AuthData[4]).bytes_le
|
||||||
|
|
||||||
#
|
#
|
||||||
# Append file content to the structure
|
# Append file content to the structure
|
||||||
|
@ -186,7 +186,7 @@ if __name__ == '__main__':
|
|||||||
# Write output file that contains hash GUID, Public Key, Signature, and Input data
|
# Write output file that contains hash GUID, Public Key, Signature, and Input data
|
||||||
#
|
#
|
||||||
args.OutputFile = open(args.OutputFileName, 'wb')
|
args.OutputFile = open(args.OutputFileName, 'wb')
|
||||||
args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.get_bytes_le())
|
args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.bytes_le)
|
||||||
args.OutputFile.write(PublicKey)
|
args.OutputFile.write(PublicKey)
|
||||||
args.OutputFile.write(Signature)
|
args.OutputFile.write(Signature)
|
||||||
args.OutputFile.write(args.InputFileBuffer)
|
args.OutputFile.write(args.InputFileBuffer)
|
||||||
|
Reference in New Issue
Block a user