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/EfiSection.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/EfiSection.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/EfiSection.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py index 5029ec7a18..7e6c88a059 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -55,10 +55,10 @@ class EfiSection (EfiSectionClassObject): #
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False) :
- if self.FileName != None and self.FileName.startswith('PCD('):
+ if self.FileName is not None and self.FileName.startswith('PCD('):
self.FileName = GenFdsGlobalVariable.GetPcdValue(self.FileName)
"""Prepare the parameter of GenSection"""
- if FfsInf != None :
+ if FfsInf is not None :
InfFileName = FfsInf.InfFileName
SectionType = FfsInf.__ExtendMacro__(self.SectionType)
Filename = FfsInf.__ExtendMacro__(self.FileName)
@@ -66,20 +66,20 @@ class EfiSection (EfiSectionClassObject): StringData = FfsInf.__ExtendMacro__(self.StringData)
NoStrip = True
if FfsInf.ModuleType in ('SEC', 'PEI_CORE', 'PEIM') and SectionType in ('TE', 'PE32'):
- if FfsInf.KeepReloc != None:
+ if FfsInf.KeepReloc is not None:
NoStrip = FfsInf.KeepReloc
- elif FfsInf.KeepRelocFromRule != None:
+ elif FfsInf.KeepRelocFromRule is not None:
NoStrip = FfsInf.KeepRelocFromRule
- elif self.KeepReloc != None:
+ elif self.KeepReloc is not None:
NoStrip = self.KeepReloc
- elif FfsInf.ShadowFromInfFile != None:
+ elif FfsInf.ShadowFromInfFile is not None:
NoStrip = FfsInf.ShadowFromInfFile
else:
EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s apply rule for None!" %ModuleName)
"""If the file name was pointed out, add it in FileList"""
FileList = []
- if Filename != None:
+ if Filename is not None:
Filename = GenFdsGlobalVariable.MacroExtend(Filename, Dict)
# check if the path is absolute or relative
if os.path.isabs(Filename):
@@ -107,14 +107,14 @@ class EfiSection (EfiSectionClassObject): if SectionType == 'VERSION':
InfOverrideVerString = False
- if FfsInf.Version != None:
+ if FfsInf.Version is not None:
#StringData = FfsInf.Version
BuildNum = FfsInf.Version
InfOverrideVerString = True
if InfOverrideVerString:
#VerTuple = ('-n', '"' + StringData + '"')
- if BuildNum != None and BuildNum != '':
+ if BuildNum is not None and BuildNum != '':
BuildNumTuple = ('-j', BuildNum)
else:
BuildNumTuple = tuple()
@@ -136,7 +136,7 @@ class EfiSection (EfiSectionClassObject): VerString = f.read()
f.close()
BuildNum = VerString
- if BuildNum != None and BuildNum != '':
+ if BuildNum is not None and BuildNum != '':
BuildNumTuple = ('-j', BuildNum)
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
#Ui=VerString,
@@ -146,7 +146,7 @@ class EfiSection (EfiSectionClassObject): else:
BuildNum = StringData
- if BuildNum != None and BuildNum != '':
+ if BuildNum is not None and BuildNum != '':
BuildNumTuple = ('-j', BuildNum)
else:
BuildNumTuple = tuple()
@@ -173,7 +173,7 @@ class EfiSection (EfiSectionClassObject): elif SectionType == 'UI':
InfOverrideUiString = False
- if FfsInf.Ui != None:
+ if FfsInf.Ui is not None:
StringData = FfsInf.Ui
InfOverrideUiString = True
@@ -196,7 +196,7 @@ class EfiSection (EfiSectionClassObject): Ui=UiString, IsMakefile=IsMakefile)
OutputFileList.append(OutputFile)
else:
- if StringData != None and len(StringData) > 0:
+ if StringData is not None and len(StringData) > 0:
UiTuple = ('-n', '"' + StringData + '"')
else:
UiTuple = tuple()
|