* [PATCH 0/2] Fix two Python 3.8 warnings
@ 2019-12-02 17:33 Philippe Mathieu-Daudé
2019-12-02 17:33 ` [PATCH 1/2] BaseTools: Avoid "is" with a literal " Philippe Mathieu-Daudé
2019-12-02 17:33 ` [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins Philippe Mathieu-Daudé
0 siblings, 2 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-02 17:33 UTC (permalink / raw)
To: devel
Cc: Sean Brogan, Zhiju . Fan, Bob Feng, Bret Barkelew, Liming Gao,
Michael D Kinney, Philippe Mathieu-Daude
Two other Python 3.8 fixes, similar to the one reported in BZ#2304:
https://bugzilla.tianocore.org/show_bug.cgi?id=2304
Regards,
Phil.
Philippe Mathieu-Daude (2):
BaseTools: Avoid "is" with a literal Python 3.8 warnings
.pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py | 2 +-
.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py | 2 +-
BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
2019-12-02 17:33 [PATCH 0/2] Fix two Python 3.8 warnings Philippe Mathieu-Daudé
@ 2019-12-02 17:33 ` Philippe Mathieu-Daudé
2019-12-05 9:58 ` Bob Feng
[not found] ` <15DD7135640BB2F8.32327@groups.io>
2019-12-02 17:33 ` [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins Philippe Mathieu-Daudé
1 sibling, 2 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-02 17:33 UTC (permalink / raw)
To: devel
Cc: Sean Brogan, Zhiju . Fan, Bob Feng, Bret Barkelew, Liming Gao,
Michael D Kinney, Philippe Mathieu-Daude
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@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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
2019-12-02 17:33 [PATCH 0/2] Fix two Python 3.8 warnings Philippe Mathieu-Daudé
2019-12-02 17:33 ` [PATCH 1/2] BaseTools: Avoid "is" with a literal " Philippe Mathieu-Daudé
@ 2019-12-02 17:33 ` Philippe Mathieu-Daudé
2019-12-05 9:59 ` [edk2-devel] " Bob Feng
[not found] ` <15DD71437DB6197D.24783@groups.io>
1 sibling, 2 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-02 17:33 UTC (permalink / raw)
To: devel
Cc: Sean Brogan, Zhiju . Fan, Bob Feng, Bret Barkelew, Liming Gao,
Michael D Kinney, Philippe Mathieu-Daude
To avoid SyntaxWarning with Python 3.8, change the 'is' operator
by the conventional '==' comparator.
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py | 2 +-
.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
index e2485f570841..9af4f72c8de3 100644
--- a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
+++ b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
@@ -61,7 +61,7 @@ class DscCompleteCheck(ICiBuildPlugin):
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dsc_path)
- if abs_dsc_path is None or wsr_dsc_path is "" or not os.path.isfile(abs_dsc_path):
+ if abs_dsc_path is None or wsr_dsc_path == "" or not os.path.isfile(abs_dsc_path):
tc.SetSkipped()
tc.LogStdError("Package Dsc not found")
return 0
diff --git a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
index 5dafcbc13f8a..a62a7e912b15 100644
--- a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
+++ b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
@@ -67,7 +67,7 @@ class LibraryClassCheck(ICiBuildPlugin):
abs_dec_path = self.__GetPkgDec(abs_pkg_path)
wsr_dec_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dec_path)
- if abs_dec_path is None or wsr_dec_path is "" or not os.path.isfile(abs_dec_path):
+ if abs_dec_path is None or wsr_dec_path == "" or not os.path.isfile(abs_dec_path):
tc.SetSkipped()
tc.LogStdError("No DEC file {0} in package {1}".format(abs_dec_path, abs_pkg_path))
return -1
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
2019-12-02 17:33 ` [PATCH 1/2] BaseTools: Avoid "is" with a literal " Philippe Mathieu-Daudé
@ 2019-12-05 9:58 ` Bob Feng
[not found] ` <15DD7135640BB2F8.32327@groups.io>
1 sibling, 0 replies; 9+ messages in thread
From: Bob Feng @ 2019-12-05 9:58 UTC (permalink / raw)
To: Philippe Mathieu-Daude, devel@edk2.groups.io
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: Philippe Mathieu-Daude [mailto:philmd@redhat.com]
Sent: Tuesday, December 3, 2019 1:33 AM
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@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@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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
2019-12-02 17:33 ` [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins Philippe Mathieu-Daudé
@ 2019-12-05 9:59 ` Bob Feng
[not found] ` <15DD71437DB6197D.24783@groups.io>
1 sibling, 0 replies; 9+ messages in thread
From: Bob Feng @ 2019-12-05 9:59 UTC (permalink / raw)
To: devel@edk2.groups.io, philmd@redhat.com
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Philippe Mathieu-Daudé
Sent: Tuesday, December 3, 2019 1:33 AM
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [edk2-devel] [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
To avoid SyntaxWarning with Python 3.8, change the 'is' operator by the conventional '==' comparator.
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py | 2 +-
.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
index e2485f570841..9af4f72c8de3 100644
--- a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
+++ b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
@@ -61,7 +61,7 @@ class DscCompleteCheck(ICiBuildPlugin):
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dsc_path)
- if abs_dsc_path is None or wsr_dsc_path is "" or not os.path.isfile(abs_dsc_path):
+ if abs_dsc_path is None or wsr_dsc_path == "" or not os.path.isfile(abs_dsc_path):
tc.SetSkipped()
tc.LogStdError("Package Dsc not found")
return 0
diff --git a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
index 5dafcbc13f8a..a62a7e912b15 100644
--- a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
+++ b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
@@ -67,7 +67,7 @@ class LibraryClassCheck(ICiBuildPlugin):
abs_dec_path = self.__GetPkgDec(abs_pkg_path)
wsr_dec_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dec_path)
- if abs_dec_path is None or wsr_dec_path is "" or not os.path.isfile(abs_dec_path):
+ if abs_dec_path is None or wsr_dec_path == "" or not os.path.isfile(abs_dec_path):
tc.SetSkipped()
tc.LogStdError("No DEC file {0} in package {1}".format(abs_dec_path, abs_pkg_path))
return -1
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
[not found] ` <15DD71437DB6197D.24783@groups.io>
@ 2019-12-05 10:07 ` Bob Feng
0 siblings, 0 replies; 9+ messages in thread
From: Bob Feng @ 2019-12-05 10:07 UTC (permalink / raw)
To: devel@edk2.groups.io, Feng, Bob C, philmd@redhat.com
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
Hi Philippe,
Please add BZ link in the commit message. After adding that, Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Thanks,
Bob
-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob Feng
Sent: Thursday, December 5, 2019 6:00 PM
To: devel@edk2.groups.io; philmd@redhat.com
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Philippe Mathieu-Daudé
Sent: Tuesday, December 3, 2019 1:33 AM
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [edk2-devel] [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins
To avoid SyntaxWarning with Python 3.8, change the 'is' operator by the conventional '==' comparator.
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py | 2 +-
.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
index e2485f570841..9af4f72c8de3 100644
--- a/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
+++ b/.pytool/Plugin/DscCompleteCheck/DscCompleteCheck.py
@@ -61,7 +61,7 @@ class DscCompleteCheck(ICiBuildPlugin):
abs_dsc_path = os.path.join(abs_pkg_path, pkgconfig["DscPath"].strip())
wsr_dsc_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dsc_path)
- if abs_dsc_path is None or wsr_dsc_path is "" or not os.path.isfile(abs_dsc_path):
+ if abs_dsc_path is None or wsr_dsc_path == "" or not os.path.isfile(abs_dsc_path):
tc.SetSkipped()
tc.LogStdError("Package Dsc not found")
return 0
diff --git a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
index 5dafcbc13f8a..a62a7e912b15 100644
--- a/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
+++ b/.pytool/Plugin/LibraryClassCheck/LibraryClassCheck.py
@@ -67,7 +67,7 @@ class LibraryClassCheck(ICiBuildPlugin):
abs_dec_path = self.__GetPkgDec(abs_pkg_path)
wsr_dec_path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(abs_dec_path)
- if abs_dec_path is None or wsr_dec_path is "" or not os.path.isfile(abs_dec_path):
+ if abs_dec_path is None or wsr_dec_path == "" or not os.path.isfile(abs_dec_path):
tc.SetSkipped()
tc.LogStdError("No DEC file {0} in package {1}".format(abs_dec_path, abs_pkg_path))
return -1
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
[not found] ` <15DD7135640BB2F8.32327@groups.io>
@ 2019-12-05 10:09 ` Bob Feng
2019-12-05 10:31 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 9+ messages in thread
From: Bob Feng @ 2019-12-05 10:09 UTC (permalink / raw)
To: devel@edk2.groups.io, Feng, Bob C, Philippe Mathieu-Daude
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
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@intel.com>
Thanks,
Bob
-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob Feng
Sent: Thursday, December 5, 2019 5:59 PM
To: Philippe Mathieu-Daude <philmd@redhat.com>; devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@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@intel.com>
-----Original Message-----
From: Philippe Mathieu-Daude [mailto:philmd@redhat.com]
Sent: Tuesday, December 3, 2019 1:33 AM
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@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@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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
2019-12-05 10:09 ` [edk2-devel] " Bob Feng
@ 2019-12-05 10:31 ` Philippe Mathieu-Daudé
2019-12-05 10:52 ` Bob Feng
0 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-05 10:31 UTC (permalink / raw)
To: Feng, Bob C, devel@edk2.groups.io
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
On 12/5/19 11:09 AM, Feng, Bob C wrote:
> 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.
Oops sorry, OK.
What BZ should I use? Should I create a new one?
> 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@intel.com>
>
> Thanks,
> Bob
>
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob Feng
> Sent: Thursday, December 5, 2019 5:59 PM
> To: Philippe Mathieu-Daude <philmd@redhat.com>; devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@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@intel.com>
>
> -----Original Message-----
> From: Philippe Mathieu-Daude [mailto:philmd@redhat.com]
> Sent: Tuesday, December 3, 2019 1:33 AM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@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@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
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
2019-12-05 10:31 ` Philippe Mathieu-Daudé
@ 2019-12-05 10:52 ` Bob Feng
0 siblings, 0 replies; 9+ messages in thread
From: Bob Feng @ 2019-12-05 10:52 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, devel@edk2.groups.io
Cc: Sean Brogan, Fan, ZhijuX, Bret Barkelew, Gao, Liming,
Kinney, Michael D
Please just use this one. https://bugzilla.tianocore.org/show_bug.cgi?id=2304
Thanks,
Bob
-----Original Message-----
From: Philippe Mathieu-Daudé [mailto:philmd@redhat.com]
Sent: Thursday, December 5, 2019 6:32 PM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings
On 12/5/19 11:09 AM, Feng, Bob C wrote:
> 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.
Oops sorry, OK.
What BZ should I use? Should I create a new one?
> 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@intel.com>
>
> Thanks,
> Bob
>
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob Feng
> Sent: Thursday, December 5, 2019 5:59 PM
> To: Philippe Mathieu-Daude <philmd@redhat.com>; devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@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@intel.com>
>
> -----Original Message-----
> From: Philippe Mathieu-Daude [mailto:philmd@redhat.com]
> Sent: Tuesday, December 3, 2019 1:33 AM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Fan, ZhijuX <zhijux.fan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Philippe Mathieu-Daude <philmd@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@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
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-12-05 10:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-02 17:33 [PATCH 0/2] Fix two Python 3.8 warnings Philippe Mathieu-Daudé
2019-12-02 17:33 ` [PATCH 1/2] BaseTools: Avoid "is" with a literal " Philippe Mathieu-Daudé
2019-12-05 9:58 ` Bob Feng
[not found] ` <15DD7135640BB2F8.32327@groups.io>
2019-12-05 10:09 ` [edk2-devel] " Bob Feng
2019-12-05 10:31 ` Philippe Mathieu-Daudé
2019-12-05 10:52 ` Bob Feng
2019-12-02 17:33 ` [PATCH 2/2] .pytool: Avoid "is" with a literal Python 3.8 warnings in CI plugins Philippe Mathieu-Daudé
2019-12-05 9:59 ` [edk2-devel] " Bob Feng
[not found] ` <15DD71437DB6197D.24783@groups.io>
2019-12-05 10:07 ` Bob Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox