diff options
author | Feng, Bob C <bob.c.feng@intel.com> | 2018-12-09 21:44:13 +0800 |
---|---|---|
committer | BobCF <bob.c.feng@intel.com> | 2018-12-15 20:13:32 +0800 |
commit | 9bf86b12ce04fcb7d997eb1fc8c55fd43d18ab79 (patch) | |
tree | d96e2eadd7fe01b4e74bef837257ed5bb18f0611 /BaseTools/Source/Python/Common | |
parent | 5695877ec8f636bd4ad873ef50eceb9da7a0f382 (diff) | |
download | edk2-9bf86b12ce04fcb7d997eb1fc8c55fd43d18ab79.tar.gz edk2-9bf86b12ce04fcb7d997eb1fc8c55fd43d18ab79.tar.bz2 edk2-9bf86b12ce04fcb7d997eb1fc8c55fd43d18ab79.zip |
BaseTools: Fixed bugs in CopyDict function
https://bugzilla.tianocore.org/show_bug.cgi?id=1387
This patch is going to fix the regression issue which is
introduced by commit bf9e636605188e291d33ab694ff1c5926b6f0800.
This patch Remove the CopyDict incorrect usage for non-dict
input data. Add a check for CopyDict input.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index b063f064fb..6a22d01012 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -2139,6 +2139,8 @@ def PackByteFormatGUID(Guid): #
def CopyDict(ori_dict):
dict_type = ori_dict.__class__
+ if dict_type not in (dict,OrderedDict):
+ return ori_dict
new_dict = dict_type()
for key in ori_dict:
if isinstance(ori_dict[key],(dict,OrderedDict)):
|