[edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings

Bob Feng bob.c.feng at intel.com
Thu Dec 5 10:09:57 UTC 2019


Hi Philippe,

Please add BZ link to the commit message and fix the following issue which is reported from PatchCheck.py

The commit message format is not valid:
 * Line 5 of commit message is too long.
 * Line 6 of commit message is too long.
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format
The code passed all checks.

After fixed, Reviewed-by: Bob Feng <bob.c.feng at intel.com>

Thanks,
Bob

-----Original Message-----
From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of Bob Feng
Sent: Thursday, December 5, 2019 5:59 PM
To: Philippe Mathieu-Daude <philmd at redhat.com>; devel at edk2.groups.io
Cc: Sean Brogan <sean.brogan at microsoft.com>; Fan, ZhijuX <zhijux.fan at intel.com>; Bret Barkelew <Bret.Barkelew at microsoft.com>; Gao, Liming <liming.gao at intel.com>; Kinney, Michael D <michael.d.kinney at intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings

Reviewed-by: Bob Feng <bob.c.feng at intel.com>

-----Original Message-----
From: Philippe Mathieu-Daude [mailto:philmd at redhat.com] 
Sent: Tuesday, December 3, 2019 1:33 AM
To: devel at edk2.groups.io
Cc: Sean Brogan <sean.brogan at microsoft.com>; Fan, ZhijuX <zhijux.fan at intel.com>; Feng, Bob C <bob.c.feng at intel.com>; Bret Barkelew <Bret.Barkelew at microsoft.com>; Gao, Liming <liming.gao at intel.com>; Kinney, Michael D <michael.d.kinney at intel.com>; Philippe Mathieu-Daude <philmd at redhat.com>
Subject: [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings

The following statement produces a SyntaxWarning with Python 3.8:

  if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
  BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py:168: SyntaxWarning: "is" with a literal. Did you mean "=="?

Change the 'is' operator by the conventional '==' comparator.

Signed-off-by: Philippe Mathieu-Daude <philmd at redhat.com>
---
 BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
index fde48b4b2788..ec0c25bd1487 100644
--- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py
@@ -165,7 +165,7 @@ class WorkspaceAutoGen(AutoGen):
             if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:
                 FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]
                 for FdRegion in FdDict.RegionList:
-                    if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
+                    if str(FdRegion.RegionType) == 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):
                         if int(FdRegion.Offset) % 8 != 0:
                             EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))
             FdfProfile = Fdf.Profile
-- 
2.21.0





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#51779): https://edk2.groups.io/g/devel/message/51779
Mute This Topic: https://groups.io/mt/65079226/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list