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