From e8d13fef90b9f9a3b3ae72342d67d0e6c5594613 Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Tue, 19 Feb 2019 18:56:03 +0800 Subject: [PATCH] BaseTools:Fixed build failure when specifying multiple BUILDTARGET With Python3, the dict.value() method returns an iterator. If a dictionary is updated while an iterator on its keys is used, a RuntimeError is generated. Converting the iterator to a list() forces a copy of the mutable keys in an immutable list which can be safely iterated. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Bob Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 8370ee0c93..f71e08d715 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -580,7 +580,7 @@ class WorkspaceAutoGen(AutoGen): if NewPcd2 not in GlobalData.MixedPcd[item]: GlobalData.MixedPcd[item].append(NewPcd2) - for BuildData in PGen.BuildDatabase._CACHE_.values(): + for BuildData in list(PGen.BuildDatabase._CACHE_.values()): if BuildData.Arch != Arch: continue for key in BuildData.Pcds: -- 2.39.2