diff options
author | Feng, YunhuaX <yunhuax.feng@intel.com> | 2018-08-08 14:56:14 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-08-23 15:01:27 +0800 |
commit | 87010d3d02547c81f1add57a4e2ef0483c65fddf (patch) | |
tree | 297ffd111cabe8b38cacbe408ceca4190385f448 /BaseTools/Source/Python/AutoGen | |
parent | abb8e6e97a72c53b1a5110cfdf2795d63acdadbc (diff) | |
download | edk2-87010d3d02547c81f1add57a4e2ef0483c65fddf.tar.gz edk2-87010d3d02547c81f1add57a4e2ef0483c65fddf.tar.bz2 edk2-87010d3d02547c81f1add57a4e2ef0483c65fddf.zip |
BaseTools: remove cmp due to deprecated in python3
remove cmp due to deprecated in python3
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 7bca6fb426..eb1b283889 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -870,7 +870,7 @@ class WorkspaceAutoGen(AutoGen): for Pa in self.AutoGenObjectList:
for Package in Pa.PackageList:
PcdList = Package.Pcds.values()
- PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0)))
+ PcdList.sort(key=lambda x: int(x.TokenValue, 0))
Count = 0
while (Count < len(PcdList) - 1) :
Item = PcdList[Count]
@@ -891,7 +891,7 @@ class WorkspaceAutoGen(AutoGen): #
# Sort same token value PCD list with TokenGuid and TokenCName
#
- SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName, y.TokenCName)))
+ SameTokenValuePcdList.sort(key=lambda x: "%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName))
SameTokenValuePcdListCount = 0
while (SameTokenValuePcdListCount < len(SameTokenValuePcdList) - 1):
Flag = False
@@ -916,7 +916,7 @@ class WorkspaceAutoGen(AutoGen): Count += 1
PcdList = Package.Pcds.values()
- PcdList.sort(lambda x, y: cmp("%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName, y.TokenCName)))
+ PcdList.sort(key=lambda x: "%s.%s" % (x.TokenSpaceGuidCName, x.TokenCName))
Count = 0
while (Count < len(PcdList) - 1) :
Item = PcdList[Count]
|