summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Misc.py
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2019-01-28 15:06:30 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-01 11:09:24 +0800
commitf8d11e5a4aaa90bf63b4789f3993dd6d16c60787 (patch)
treece3fc46810e582eca7084e49b51121ee5a696605 /BaseTools/Source/Python/Common/Misc.py
parent7fa0e68afd658bda001aaccf616837a4a493a385 (diff)
downloadedk2-f8d11e5a4aaa90bf63b4789f3993dd6d16c60787.tar.gz
edk2-f8d11e5a4aaa90bf63b4789f3993dd6d16c60787.tar.bz2
edk2-f8d11e5a4aaa90bf63b4789f3993dd6d16c60787.zip
BaseTools: the list and iterator translation
In python3,The keys of the dictionary not a list,It needs to be converted Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index e0e355286b..d3b71fc4a2 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -574,13 +574,14 @@ def RealPath(File, Dir='', OverrideDir=''):
#
def GuidValue(CName, PackageList, Inffile = None):
for P in PackageList:
- GuidKeys = P.Guids.keys()
+ GuidKeys = list(P.Guids.keys())
if Inffile and P._PrivateGuids:
if not Inffile.startswith(P.MetaFile.Dir):
GuidKeys = [x for x in P.Guids if x not in P._PrivateGuids]
if CName in GuidKeys:
return P.Guids[CName]
return None
+ return None
## A string template class
#
@@ -1637,7 +1638,7 @@ class SkuClass():
self.SkuIdSet = ['DEFAULT']
self.SkuIdNumberSet = ['0U']
elif SkuIdentifier == 'ALL':
- self.SkuIdSet = SkuIds.keys()
+ self.SkuIdSet = list(SkuIds.keys())
self.SkuIdNumberSet = [num[0].strip() + 'U' for num in SkuIds.values()]
else:
r = SkuIdentifier.split('|')