]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FfsFileStatement.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FfsFileStatement.py
index 12ec95b5650163a9b240e4b3e4e9077907987478..3fd5a9c2158a6f7d3e20779d9cb2312a53432ccd 100644 (file)
@@ -59,7 +59,7 @@ class FileStatement (FileStatementClassObject) :
     #\r
     def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None, IsMakefile=False, FvName=None):\r
         \r
-        if self.NameGuid != None and self.NameGuid.startswith('PCD('):\r
+        if self.NameGuid is not None and self.NameGuid.startswith('PCD('):\r
             PcdValue = GenFdsGlobalVariable.GetPcdValue(self.NameGuid)\r
             if len(PcdValue) == 0:\r
                 EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \\r
@@ -81,7 +81,7 @@ class FileStatement (FileStatementClassObject) :
 \r
         Dict.update(self.DefineVarDict)\r
         SectionAlignments = None\r
-        if self.FvName != None :\r
+        if self.FvName is not None :\r
             Buffer = StringIO.StringIO('')\r
             if self.FvName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
                 EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT described in FDF file!" % (self.FvName))\r
@@ -89,14 +89,14 @@ class FileStatement (FileStatementClassObject) :
             FileName = Fv.AddToBuffer(Buffer)\r
             SectionFiles = [FileName]\r
 \r
-        elif self.FdName != None:\r
+        elif self.FdName is not None:\r
             if self.FdName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
                 EdkLogger.error("GenFds", GENFDS_ERROR, "FD (%s) is NOT described in FDF file!" % (self.FdName))\r
             Fd = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper())\r
             FileName = Fd.GenFd()\r
             SectionFiles = [FileName]\r
 \r
-        elif self.FileName != None:\r
+        elif self.FileName is not None:\r
             if hasattr(self, 'FvFileType') and self.FvFileType == 'RAW':\r
                 if isinstance(self.FileName, list) and isinstance(self.SubAlignment, list) and len(self.FileName) == len(self.SubAlignment):\r
                     FileContent = ''\r
@@ -110,7 +110,7 @@ class FileStatement (FileStatementClassObject) :
                         Content = f.read()\r
                         f.close()\r
                         AlignValue = 1\r
-                        if self.SubAlignment[Index] != None:\r
+                        if self.SubAlignment[Index] is not None:\r
                             AlignValue = GenFdsGlobalVariable.GetAlignment(self.SubAlignment[Index])\r
                         if AlignValue > MaxAlignValue:\r
                             MaxAlignIndex = Index\r
@@ -151,7 +151,7 @@ class FileStatement (FileStatementClassObject) :
                         section.FvAddr = FvChildAddr.pop(0)\r
                     elif isinstance(section, GuidSection):\r
                         section.FvAddr = FvChildAddr\r
-                if FvParentAddr != None and isinstance(section, GuidSection):\r
+                if FvParentAddr is not None and isinstance(section, GuidSection):\r
                     section.FvParentAddr = FvParentAddr\r
 \r
                 if self.KeepReloc == False:\r