In python3, reduce() is not a built-in function anymore.
Import it from "functools" to be compatible with python 3.

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Gary Lin <[email protected]>
---
 BaseTools/Source/Python/AutoGen/GenPcdDb.py | 1 +
 BaseTools/Source/Python/AutoGen/GenVar.py   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py 
b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index b4955ea7ebab..a989cb34dff3 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -21,6 +21,7 @@ from ValidCheckingInfoObject import VAR_VALID_OBJECT_FACTORY
 from Common.VariableAttributes import VariableAttributes
 import copy
 from struct import unpack
+from functools import reduce
 
 DATABASE_VERSION = 7
 
diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py 
b/BaseTools/Source/Python/AutoGen/GenVar.py
index 8e800c8bc914..b82d7e4d2d37 100644
--- a/BaseTools/Source/Python/AutoGen/GenVar.py
+++ b/BaseTools/Source/Python/AutoGen/GenVar.py
@@ -21,6 +21,7 @@ import copy
 from Common.VariableAttributes import VariableAttributes
 from Common.Misc import *
 import collections
+from functools import reduce
 
 var_info = collections.namedtuple("uefi_var", 
"pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, 
var_offset,var_attribute,pcd_default_value, default_value, data_type")
 NvStorageHeaderSize = 28
-- 
2.16.1

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

Reply via email to