]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:Fixed build failure when specifying multiple BUILDTARGET
authorFan, ZhijuX <zhijux.fan@intel.com>
Tue, 19 Feb 2019 10:56:03 +0000 (18:56 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Wed, 20 Feb 2019 05:16:57 +0000 (13:16 +0800)
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 <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index 8370ee0c9386e5f4039c2743f498f252af968269..f71e08d7154dbff37595a63b4b3dd8d8732ca1f3 100644 (file)
@@ -580,7 +580,7 @@ class WorkspaceAutoGen(AutoGen):
                                 if NewPcd2 not in GlobalData.MixedPcd[item]:\r
                                     GlobalData.MixedPcd[item].append(NewPcd2)\r
 \r
-            for BuildData in PGen.BuildDatabase._CACHE_.values():\r
+            for BuildData in list(PGen.BuildDatabase._CACHE_.values()):\r
                 if BuildData.Arch != Arch:\r
                     continue\r
                 for key in BuildData.Pcds:\r