diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-27 04:25:43 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-03-30 08:25:13 +0800 |
commit | 4231a8193ec0d52df7e0a101d96c51b1a2b7a996 (patch) | |
tree | 4fc8e46c9d51a4938e891e6b029781f1b66537ae /BaseTools/Source/Python/GenFds/Region.py | |
parent | 05a32984ab799a564e2eeb7dff128fe0992910d8 (diff) | |
download | edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.gz edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.tar.bz2 edk2-4231a8193ec0d52df7e0a101d96c51b1a2b7a996.zip |
BaseTools: Remove equality operator with None
replace "== None" with "is None" and "!= None" with "is not None"
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/Region.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/Region.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py index c946758cf5..e639739b7e 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -114,7 +114,7 @@ class Region(RegionClassObject): if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(RegionData.upper())
- if FvObj != None :
+ if FvObj is not None :
if not Flag:
GenFdsGlobalVariable.InfLogger(' Region Name = FV')
#
@@ -152,7 +152,7 @@ class Region(RegionClassObject): # Add the exist Fv image into FD buffer
#
if not Flag:
- if FileName != None:
+ if FileName is not None:
FileLength = os.stat(FileName)[ST_SIZE]
if FileLength > Size:
EdkLogger.error("GenFds", GENFDS_ERROR,
@@ -193,7 +193,7 @@ class Region(RegionClassObject): if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[RegionData.upper()]
- if CapsuleObj != None :
+ if CapsuleObj is not None :
CapsuleObj.CapsuleName = RegionData.upper()
GenFdsGlobalVariable.InfLogger(' Region Name = CAPSULE')
#
@@ -270,7 +270,7 @@ class Region(RegionClassObject): #
self.PadBuffer(Buffer, ErasePolarity, Size)
- if self.RegionType == None:
+ if self.RegionType is None:
GenFdsGlobalVariable.InfLogger(' Region Name = None')
self.PadBuffer(Buffer, ErasePolarity, Size)
@@ -333,7 +333,7 @@ class Region(RegionClassObject): # first check whether FvObj.BlockSizeList items have only "BlockSize" or "NumBlocks",
# if so, use ExpectedList
for Item in FvObj.BlockSizeList:
- if Item[0] == None or Item[1] == None:
+ if Item[0] is None or Item[1] is None:
FvObj.BlockSizeList = ExpectedList
break
# make sure region size is no smaller than the summed block size in FV
|