diff options
author | Feng, YunhuaX <yunhuax.feng@intel.com> | 2018-08-08 14:55:35 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-08-23 15:01:27 +0800 |
commit | abb8e6e97a72c53b1a5110cfdf2795d63acdadbc (patch) | |
tree | f522d000425e88d74f9d60324f30ec0776fd55d4 /BaseTools/Source/Python/Workspace/WorkspaceCommon.py | |
parent | c1260801fdfb89c91878984dfbc3c5a125696886 (diff) | |
download | edk2-abb8e6e97a72c53b1a5110cfdf2795d63acdadbc.tar.gz edk2-abb8e6e97a72c53b1a5110cfdf2795d63acdadbc.tar.bz2 edk2-abb8e6e97a72c53b1a5110cfdf2795d63acdadbc.zip |
BaseTools: Modify class OrderedListDict
class OrderedListDict(OrderedDict, defaultdict) will
encounter multiple bases have instance lay-out
conflict error on python3
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/WorkspaceCommon.py')
-rw-r--r-- | BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 6 |
1 files changed, 5 insertions, 1 deletions
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
|