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