Re: [edk2] [Patch 2/2] BaseTools: Fix a Eot issue.

2019-02-25 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Feng, 
> Bob C
> Sent: Monday, February 25, 2019 5:23 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch 2/2] BaseTools: Fix a Eot issue.
> 
> FirmwareVolume.UnDispatchedFfsDict is mutated during iteration,
> convert the FirmwareVolume.UnDispatchedFfsDict.keys() to a new list
>  to resolve this problem.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Eot/EotMain.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py 
> b/BaseTools/Source/Python/Eot/EotMain.py
> index 3020f6525e..4802aea8b1 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -389,11 +389,11 @@ class FirmwareVolume(Image):
>  FfsSecCoreGuid = None
>  FfsPeiCoreGuid = None
>  FfsDxeCoreGuid = None
>  FfsPeiPrioriGuid = None
>  FfsDxePrioriGuid = None
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x03:
>  FfsSecCoreGuid = FfsID
>  continue
>  if Ffs.Type == 0x04:
> @@ -495,11 +495,11 @@ class FirmwareVolume(Image):
>  EotGlobalData.gPpiList[Record[0].lower()] = ModuleGuid
> 
>  def DisPatchDxe(self, Db):
>  IsInstalled = False
>  ScheduleList = sdict()
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  CouldBeLoaded = False
>  DepexString = ''
>  FileDepex = None
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x07:
> @@ -560,11 +560,11 @@ class FirmwareVolume(Image):
>  if IsInstalled:
>  self.DisPatchDxe(Db)
> 
>  def DisPatchPei(self, Db):
>  IsInstalled = False
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  CouldBeLoaded = True
>  DepexString = ''
>  FileDepex = None
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x06 or Ffs.Type == 0x08:
> --
> 2.20.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 2/2] BaseTools: Fix a Eot issue.

2019-02-25 Thread Feng, Bob C
FirmwareVolume.UnDispatchedFfsDict is mutated during iteration,
convert the FirmwareVolume.UnDispatchedFfsDict.keys() to a new list
 to resolve this problem.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/Eot/EotMain.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/Eot/EotMain.py 
b/BaseTools/Source/Python/Eot/EotMain.py
index 3020f6525e..4802aea8b1 100644
--- a/BaseTools/Source/Python/Eot/EotMain.py
+++ b/BaseTools/Source/Python/Eot/EotMain.py
@@ -389,11 +389,11 @@ class FirmwareVolume(Image):
 FfsSecCoreGuid = None
 FfsPeiCoreGuid = None
 FfsDxeCoreGuid = None
 FfsPeiPrioriGuid = None
 FfsDxePrioriGuid = None
-for FfsID in self.UnDispatchedFfsDict.keys():
+for FfsID in list(self.UnDispatchedFfsDict.keys()):
 Ffs = self.UnDispatchedFfsDict[FfsID]
 if Ffs.Type == 0x03:
 FfsSecCoreGuid = FfsID
 continue
 if Ffs.Type == 0x04:
@@ -495,11 +495,11 @@ class FirmwareVolume(Image):
 EotGlobalData.gPpiList[Record[0].lower()] = ModuleGuid
 
 def DisPatchDxe(self, Db):
 IsInstalled = False
 ScheduleList = sdict()
-for FfsID in self.UnDispatchedFfsDict.keys():
+for FfsID in list(self.UnDispatchedFfsDict.keys()):
 CouldBeLoaded = False
 DepexString = ''
 FileDepex = None
 Ffs = self.UnDispatchedFfsDict[FfsID]
 if Ffs.Type == 0x07:
@@ -560,11 +560,11 @@ class FirmwareVolume(Image):
 if IsInstalled:
 self.DisPatchDxe(Db)
 
 def DisPatchPei(self, Db):
 IsInstalled = False
-for FfsID in self.UnDispatchedFfsDict.keys():
+for FfsID in list(self.UnDispatchedFfsDict.keys()):
 CouldBeLoaded = True
 DepexString = ''
 FileDepex = None
 Ffs = self.UnDispatchedFfsDict[FfsID]
 if Ffs.Type == 0x06 or Ffs.Type == 0x08:
-- 
2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel