From abb8e6e97a72c53b1a5110cfdf2795d63acdadbc Mon Sep 17 00:00:00 2001 From: "Feng, YunhuaX" Date: Wed, 8 Aug 2018 14:55:35 +0800 Subject: [PATCH] BaseTools: Modify class OrderedListDict class OrderedListDict(OrderedDict, defaultdict) will encounter multiple bases have instance lay-out conflict error on python3 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index d987bbf441..8d8a3e2789 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -21,11 +21,15 @@ from Common.BuildToolError import RESOURCE_NOT_AVAILABLE from Common.BuildToolError import OPTION_MISSING from Common.BuildToolError import BUILD_ERROR -class OrderedListDict(OrderedDict, defaultdict): +class OrderedListDict(OrderedDict): def __init__(self, *args, **kwargs): super(OrderedListDict, self).__init__(*args, **kwargs) self.default_factory = list + def __missing__(self, key): + self[key] = Value = self.default_factory() + return Value + ## Get all packages from platform for specified arch, target and toolchain # # @param Platform: DscBuildData instance