From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ABA27210DF74C for ; Tue, 7 Aug 2018 23:56:28 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 23:56:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="dat'59?scan'59,208,59";a="252919519" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 07 Aug 2018 23:56:19 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 23:56:18 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 23:56:18 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Wed, 8 Aug 2018 14:56:15 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH 2/3] BaseTools: remove cmp due to deprecated in python3 Thread-Index: AdQu5OU75OwAiv4jR0iCUFUD/PDjuw== Date: Wed, 8 Aug 2018 06:56:14 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48B6A25@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC48B6A25@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.27 Subject: [PATCH 2/3] BaseTools: remove cmp due to deprecated in python3 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 06:56:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable remove cmp due to deprecated in python3 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 +++--- BaseTools/Source/Python/BPDG/GenVpd.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 06ff84b4cd..a926a27c6e 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -997,11 +997,11 @@ class WorkspaceAutoGen(AutoGen): # def _CheckAllPcdsTokenValueConflict(self): for Pa in self.AutoGenObjectList: for Package in Pa.PackageList: PcdList =3D Package.Pcds.values() - PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.= TokenValue, 0))) + PcdList.sort(key=3Dlambda x: int(x.TokenValue, 0)) Count =3D 0 while (Count < len(PcdList) - 1) : Item =3D PcdList[Count] ItemNext =3D PcdList[Count + 1] # @@ -1018,11 +1018,11 @@ class WorkspaceAutoGen(AutoGen): else: break; # # Sort same token value PCD list with TokenGuid an= d TokenCName # - SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s= " % (x.TokenSpaceGuidCName, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName= , y.TokenCName))) + SameTokenValuePcdList.sort(key=3Dlambda x: "%s.%s"= % (x.TokenSpaceGuidCName, x.TokenCName)) SameTokenValuePcdListCount =3D 0 while (SameTokenValuePcdListCount < len(SameTokenV= aluePcdList) - 1): Flag =3D False TemListItem =3D SameTokenValuePcdList[SameToke= nValuePcdListCount] TemListItemNext =3D SameTokenValuePcdList[Same= TokenValuePcdListCount + 1] @@ -1043,11 +1043,11 @@ class WorkspaceAutoGen(AutoGen): SameTokenValuePcdListCount +=3D 1 Count +=3D SameTokenValuePcdListCount Count +=3D 1 =20 PcdList =3D Package.Pcds.values() - PcdList.sort(lambda x, y: cmp("%s.%s" % (x.TokenSpaceGuidC= Name, x.TokenCName), "%s.%s" % (y.TokenSpaceGuidCName, y.TokenCName))) + PcdList.sort(key=3Dlambda x: "%s.%s" % (x.TokenSpaceGuidCN= ame, x.TokenCName)) Count =3D 0 while (Count < len(PcdList) - 1) : Item =3D PcdList[Count] ItemNext =3D PcdList[Count + 1] # diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Pyth= on/BPDG/GenVpd.py index cd272a2d9a..c5e91a3e81 100644 --- a/BaseTools/Source/Python/BPDG/GenVpd.py +++ b/BaseTools/Source/Python/BPDG/GenVpd.py @@ -502,16 +502,16 @@ class GenVPD : def FixVpdOffset (self): # At first, the offset should start at 0 # Sort fixed offset list in order to find out where has free space= s for the pcd's offset # value is "*" to insert into. =20 - self.PcdFixedOffsetSizeList.sort(lambda x, y: cmp(x.PcdBinOffset, = y.PcdBinOffset)) + self.PcdFixedOffsetSizeList.sort(key=3Dlambda x: x.PcdBinOffset) =20 # # Sort the un-fixed pcd's offset by it's size. # - self.PcdUnknownOffsetList.sort(lambda x, y: cmp(x.PcdBinSize, y.Pc= dBinSize)) + self.PcdUnknownOffsetList.sort(key=3Dlambda x: x.PcdBinSize) =20 index =3D0 for pcd in self.PcdUnknownOffsetList: index +=3D 1 if pcd.PcdCName =3D=3D ".".join(("gEfiMdeModulePkgTokenSpaceGu= id", "PcdNvStoreDefaultValueBuffer")): --=20 2.12.2.windows.2