]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index aeeab9190473c7af9b85819d34c8f164e93644b8..3384fdb70b7ef2b1f292db5992e88ab6ba4a35fc 100644 (file)
@@ -766,7 +766,7 @@ class WorkspaceAutoGen(AutoGen):
         for Fv in Fdf.Profile.FvDict:\r
             _GuidDict = {}\r
             for FfsFile in Fdf.Profile.FvDict[Fv].FfsList:\r
-                if FfsFile.InfFileName and FfsFile.NameGuid == None:\r
+                if FfsFile.InfFileName and FfsFile.NameGuid is None:\r
                     #\r
                     # Get INF file GUID\r
                     #\r
@@ -817,7 +817,7 @@ class WorkspaceAutoGen(AutoGen):
                                                 ExtraData=self.FdfFile)\r
                         InfFoundFlag = False\r
 \r
-                if FfsFile.NameGuid != None:\r
+                if FfsFile.NameGuid is not None:\r
                     _CheckPCDAsGuidPattern = re.compile("^PCD\(.+\..+\)$")\r
 \r
                     #\r
@@ -939,13 +939,13 @@ class WorkspaceAutoGen(AutoGen):
 \r
     ## Return the directory to store FV files\r
     def _GetFvDir(self):\r
-        if self._FvDir == None:\r
+        if self._FvDir is None:\r
             self._FvDir = path.join(self.BuildDir, 'FV')\r
         return self._FvDir\r
 \r
     ## Return the directory to store all intermediate and final files built\r
     def _GetBuildDir(self):\r
-        if self._BuildDir == None:\r
+        if self._BuildDir is None:\r
             return self.AutoGenObjectList[0].BuildDir\r
 \r
     ## Return the build output directory platform specifies\r
@@ -973,7 +973,7 @@ class WorkspaceAutoGen(AutoGen):
     #   @retval     string  Makefile directory\r
     #\r
     def _GetMakeFileDir(self):\r
-        if self._MakeFileDir == None:\r
+        if self._MakeFileDir is None:\r
             self._MakeFileDir = self.BuildDir\r
         return self._MakeFileDir\r
 \r
@@ -982,7 +982,7 @@ class WorkspaceAutoGen(AutoGen):
     #   @retval     string  Build command string\r
     #\r
     def _GetBuildCommand(self):\r
-        if self._BuildCommand == None:\r
+        if self._BuildCommand is None:\r
             # BuildCommand should be all the same. So just get one from platform AutoGen\r
             self._BuildCommand = self.AutoGenObjectList[0].BuildCommand\r
         return self._BuildCommand\r
@@ -1215,7 +1215,7 @@ class PlatformAutoGen(AutoGen):
 \r
         self.VariableInfo = None\r
 \r
-        if GlobalData.gFdfParser != None:\r
+        if GlobalData.gFdfParser is not None:\r
             self._AsBuildInfList = GlobalData.gFdfParser.Profile.InfList\r
             for Inf in self._AsBuildInfList:\r
                 InfClass = PathClass(NormPath(Inf), GlobalData.gWorkspace, self.Arch)\r
@@ -1331,7 +1331,7 @@ class PlatformAutoGen(AutoGen):
             for SkuName in Pcd.SkuInfoList:\r
                 Sku = Pcd.SkuInfoList[SkuName]\r
                 SkuId = Sku.SkuId\r
-                if SkuId == None or SkuId == '':\r
+                if SkuId is None or SkuId == '':\r
                     continue\r
                 if len(Sku.VariableName) > 0:\r
                     VariableGuidStructure = Sku.VariableGuidValue\r
@@ -1642,7 +1642,7 @@ class PlatformAutoGen(AutoGen):
                         # if the offset of a VPD is *, then it need to be fixed up by third party tool.\r
                         if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":\r
                             NeedProcessVpdMapFile = True\r
-                            if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':\r
+                            if self.Platform.VpdToolGuid is None or self.Platform.VpdToolGuid == '':\r
                                 EdkLogger.error("Build", FILE_NOT_FOUND, \\r
                                                 "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
 \r
@@ -1654,7 +1654,7 @@ class PlatformAutoGen(AutoGen):
             for DscPcd in PlatformPcds:\r
                 DscPcdEntry = self._PlatformPcds[DscPcd]\r
                 if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:\r
-                    if not (self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == ''):\r
+                    if not (self.Platform.VpdToolGuid is None or self.Platform.VpdToolGuid == ''):\r
                         FoundFlag = False\r
                         for VpdPcd in VpdFile._VpdArray.keys():\r
                             # This PCD has been referenced by module\r
@@ -1734,7 +1734,7 @@ class PlatformAutoGen(AutoGen):
 \r
                                 # if the offset of a VPD is *, then it need to be fixed up by third party tool.\r
                             VpdSkuMap[DscPcd] = SkuValueMap\r
-            if (self.Platform.FlashDefinition == None or self.Platform.FlashDefinition == '') and \\r
+            if (self.Platform.FlashDefinition is None or self.Platform.FlashDefinition == '') and \\r
                VpdFile.GetCount() != 0:\r
                 EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, \r
                                 "Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))\r
@@ -1817,14 +1817,14 @@ class PlatformAutoGen(AutoGen):
                     BPDGToolName = ToolDef["PATH"]\r
                     break\r
             # Call third party GUID BPDG tool.\r
-            if BPDGToolName != None:\r
+            if BPDGToolName is not None:\r
                 VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)\r
             else:\r
                 EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")\r
 \r
     ## Return the platform build data object\r
     def _GetPlatform(self):\r
-        if self._Platform == None:\r
+        if self._Platform is None:\r
             self._Platform = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]\r
         return self._Platform\r
 \r
@@ -1842,7 +1842,7 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Return the FDF file name\r
     def _GetFdfFile(self):\r
-        if self._FdfFile == None:\r
+        if self._FdfFile is None:\r
             if self.Workspace.FdfFile != "":\r
                 self._FdfFile= mws.join(self.WorkspaceDir, self.Workspace.FdfFile)\r
             else:\r
@@ -1855,7 +1855,7 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Return the directory to store all intermediate and final files built\r
     def _GetBuildDir(self):\r
-        if self._BuildDir == None:\r
+        if self._BuildDir is None:\r
             if os.path.isabs(self.OutputDir):\r
                 self._BuildDir = path.join(\r
                                             path.abspath(self.OutputDir),\r
@@ -1875,7 +1875,7 @@ class PlatformAutoGen(AutoGen):
     #   @retval     string  Makefile directory\r
     #\r
     def _GetMakeFileDir(self):\r
-        if self._MakeFileDir == None:\r
+        if self._MakeFileDir is None:\r
             self._MakeFileDir = path.join(self.BuildDir, self.Arch)\r
         return self._MakeFileDir\r
 \r
@@ -1884,7 +1884,7 @@ class PlatformAutoGen(AutoGen):
     #   @retval     string  Build command string\r
     #\r
     def _GetBuildCommand(self):\r
-        if self._BuildCommand == None:\r
+        if self._BuildCommand is None:\r
             self._BuildCommand = []\r
             if "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:\r
                 self._BuildCommand += SplitOption(self.ToolDefinition["MAKE"]["PATH"])\r
@@ -1906,7 +1906,7 @@ class PlatformAutoGen(AutoGen):
     #  Get each tool defition for given tool chain from tools_def.txt and platform\r
     #\r
     def _GetToolDefinition(self):\r
-        if self._ToolDefinitions == None:\r
+        if self._ToolDefinitions is None:\r
             ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDictionary\r
             if TAB_TOD_DEFINES_COMMAND_TYPE not in self.Workspace.ToolDef.ToolsDefTxtDatabase:\r
                 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No tools found in configuration",\r
@@ -1972,13 +1972,13 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Return the paths of tools\r
     def _GetToolDefFile(self):\r
-        if self._ToolDefFile == None:\r
+        if self._ToolDefFile is None:\r
             self._ToolDefFile = os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch)\r
         return self._ToolDefFile\r
 \r
     ## Retrieve the toolchain family of given toolchain tag. Default to 'MSFT'.\r
     def _GetToolChainFamily(self):\r
-        if self._ToolChainFamily == None:\r
+        if self._ToolChainFamily is None:\r
             ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase\r
             if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \\r
                or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \\r
@@ -1991,7 +1991,7 @@ class PlatformAutoGen(AutoGen):
         return self._ToolChainFamily\r
 \r
     def _GetBuildRuleFamily(self):\r
-        if self._BuildRuleFamily == None:\r
+        if self._BuildRuleFamily is None:\r
             ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase\r
             if TAB_TOD_DEFINES_BUILDRULEFAMILY not in ToolDefinition \\r
                or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY] \\r
@@ -2005,19 +2005,19 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Return the build options specific for all modules in this platform\r
     def _GetBuildOptions(self):\r
-        if self._BuildOption == None:\r
+        if self._BuildOption is None:\r
             self._BuildOption = self._ExpandBuildOption(self.Platform.BuildOptions)\r
         return self._BuildOption\r
 \r
     ## Return the build options specific for EDK modules in this platform\r
     def _GetEdkBuildOptions(self):\r
-        if self._EdkBuildOption == None:\r
+        if self._EdkBuildOption is None:\r
             self._EdkBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDK_NAME)\r
         return self._EdkBuildOption\r
 \r
     ## Return the build options specific for EDKII modules in this platform\r
     def _GetEdkIIBuildOptions(self):\r
-        if self._EdkIIBuildOption == None:\r
+        if self._EdkIIBuildOption is None:\r
             self._EdkIIBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDKII_NAME)\r
         return self._EdkIIBuildOption\r
 \r
@@ -2026,7 +2026,7 @@ class PlatformAutoGen(AutoGen):
     #   @retval     BuildRule object\r
     #\r
     def _GetBuildRule(self):\r
-        if self._BuildRule == None:\r
+        if self._BuildRule is None:\r
             BuildRuleFile = None\r
             if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:\r
                 BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]\r
@@ -2046,7 +2046,7 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Summarize the packages used by modules in this platform\r
     def _GetPackageList(self):\r
-        if self._PackageList == None:\r
+        if self._PackageList is None:\r
             self._PackageList = set()\r
             for La in self.LibraryAutoGenList:\r
                 self._PackageList.update(La.DependentPackageList)\r
@@ -2071,19 +2071,19 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Get list of non-dynamic PCDs\r
     def _GetNonDynamicPcdList(self):\r
-        if self._NonDynamicPcdList == None:\r
+        if self._NonDynamicPcdList is None:\r
             self.CollectPlatformDynamicPcds()\r
         return self._NonDynamicPcdList\r
 \r
     ## Get list of dynamic PCDs\r
     def _GetDynamicPcdList(self):\r
-        if self._DynamicPcdList == None:\r
+        if self._DynamicPcdList is None:\r
             self.CollectPlatformDynamicPcds()\r
         return self._DynamicPcdList\r
 \r
     ## Generate Token Number for all PCD\r
     def _GetPcdTokenNumbers(self):\r
-        if self._PcdTokenNumber == None:\r
+        if self._PcdTokenNumber is None:\r
             self._PcdTokenNumber = sdict()\r
             TokenNumber = 1\r
             #\r
@@ -2151,13 +2151,13 @@ class PlatformAutoGen(AutoGen):
 \r
     ## Summarize ModuleAutoGen objects of all modules to be built for this platform\r
     def _GetModuleAutoGenList(self):\r
-        if self._ModuleAutoGenList == None:\r
+        if self._ModuleAutoGenList is None:\r
             self._GetAutoGenObjectList()\r
         return self._ModuleAutoGenList\r
 \r
     ## Summarize ModuleAutoGen objects of all libraries to be built for this platform\r
     def _GetLibraryAutoGenList(self):\r
-        if self._LibraryAutoGenList == None:\r
+        if self._LibraryAutoGenList is None:\r
             self._GetAutoGenObjectList()\r
         return self._LibraryAutoGenList\r
 \r
@@ -2221,9 +2221,9 @@ class PlatformAutoGen(AutoGen):
                         LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]\r
                     else:\r
                         LibraryPath = self.Platform.LibraryClasses[LibraryClassName, ModuleType]\r
-                    if LibraryPath == None or LibraryPath == "":\r
+                    if LibraryPath is None or LibraryPath == "":\r
                         LibraryPath = M.LibraryClasses[LibraryClassName]\r
-                        if LibraryPath == None or LibraryPath == "":\r
+                        if LibraryPath is None or LibraryPath == "":\r
                             EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,\r
                                             "Instance of library class [%s] is not found" % LibraryClassName,\r
                                             File=self.MetaFile,\r
@@ -2233,7 +2233,7 @@ class PlatformAutoGen(AutoGen):
                     # for those forced library instance (NULL library), add a fake library class\r
                     if LibraryClassName.startswith("NULL"):\r
                         LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))\r
-                    elif LibraryModule.LibraryClass == None \\r
+                    elif LibraryModule.LibraryClass is None \\r
                          or len(LibraryModule.LibraryClass) == 0 \\r
                          or (ModuleType != 'USER_DEFINED'\r
                              and ModuleType not in LibraryModule.LibraryClass[0].SupModList):\r
@@ -2249,7 +2249,7 @@ class PlatformAutoGen(AutoGen):
                 else:\r
                     LibraryModule = LibraryInstance[LibraryClassName]\r
 \r
-                if LibraryModule == None:\r
+                if LibraryModule is None:\r
                     continue\r
 \r
                 if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:\r
@@ -2357,7 +2357,7 @@ class PlatformAutoGen(AutoGen):
             if (ToPcd.TokenCName, ToPcd.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:\r
                 TokenCName = PcdItem[0]\r
                 break\r
-        if FromPcd != None:\r
+        if FromPcd is not None:\r
             if ToPcd.Pending and FromPcd.Type not in [None, '']:\r
                 ToPcd.Type = FromPcd.Type\r
             elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
@@ -2401,7 +2401,7 @@ class PlatformAutoGen(AutoGen):
             ToPcd.validlists = FromPcd.validlists\r
             ToPcd.expressions = FromPcd.expressions\r
 \r
-        if FromPcd != None and ToPcd.DatumType == "VOID*" and ToPcd.MaxDatumSize in ['', None]:\r
+        if FromPcd is not None and ToPcd.DatumType == "VOID*" and ToPcd.MaxDatumSize in ['', None]:\r
             EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \\r
                             % (ToPcd.TokenSpaceGuidCName, TokenCName))\r
             Value = ToPcd.DefaultValue\r
@@ -2447,7 +2447,7 @@ class PlatformAutoGen(AutoGen):
                 Sku = PcdInModule.SkuInfoList[SkuId]\r
                 if Sku.VariableGuid == '': continue\r
                 Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)\r
-                if Sku.VariableGuidValue == None:\r
+                if Sku.VariableGuidValue is None:\r
                     PackageList = "\n\t".join([str(P) for P in self.PackageList])\r
                     EdkLogger.error(\r
                                 'build',\r
@@ -2510,12 +2510,12 @@ class PlatformAutoGen(AutoGen):
             M = LibraryConsumerList.pop()\r
             for LibraryName in M.Libraries:\r
                 Library = self.Platform.LibraryClasses[LibraryName, ':dummy:']\r
-                if Library == None:\r
+                if Library is None:\r
                     for Key in self.Platform.LibraryClasses.data.keys():\r
                         if LibraryName.upper() == Key.upper():\r
                             Library = self.Platform.LibraryClasses[Key, ':dummy:']\r
                             break\r
-                    if Library == None:\r
+                    if Library is None:\r
                         EdkLogger.warn("build", "Library [%s] is not found" % LibraryName, File=str(M),\r
                             ExtraData="\t%s [%s]" % (str(Module), self.Arch))\r
                         continue\r
@@ -2570,13 +2570,13 @@ class PlatformAutoGen(AutoGen):
             # Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE\r
             #\r
             if (Key[0] == self.BuildRuleFamily and\r
-                (ModuleStyle == None or len(Key) < 3 or (len(Key) > 2 and Key[2] == ModuleStyle))):\r
+                (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 and Key[2] == ModuleStyle))):\r
                 Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')\r
                 if Target == self.BuildTarget or Target == "*":\r
                     if ToolChain == self.ToolChain or ToolChain == "*":\r
                         if Arch == self.Arch or Arch == "*":\r
                             if Options[Key].startswith("="):\r
-                                if OverrideList.get(Key[1]) != None:\r
+                                if OverrideList.get(Key[1]) is not None:\r
                                     OverrideList.pop(Key[1])\r
                                 OverrideList[Key[1]] = Options[Key]\r
         \r
@@ -2600,14 +2600,14 @@ class PlatformAutoGen(AutoGen):
                                 if CommandType1 == CommandType2 or CommandType1 == "*" or CommandType2 == "*":\r
                                     if Attr1 == Attr2 or Attr1 == "*" or Attr2 == "*":\r
                                         if self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):\r
-                                            if Options.get((self.BuildRuleFamily, NextKey)) != None:\r
+                                            if Options.get((self.BuildRuleFamily, NextKey)) is not None:\r
                                                 Options.pop((self.BuildRuleFamily, NextKey))\r
                                         else:\r
-                                            if Options.get((self.BuildRuleFamily, NowKey)) != None:\r
+                                            if Options.get((self.BuildRuleFamily, NowKey)) is not None:\r
                                                 Options.pop((self.BuildRuleFamily, NowKey))\r
                                                            \r
         for Key in Options:\r
-            if ModuleStyle != None and len (Key) > 2:\r
+            if ModuleStyle is not None and len (Key) > 2:\r
                 # Check Module style is EDK or EDKII.\r
                 # Only append build option for the matched style module.\r
                 if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:\r
@@ -2644,7 +2644,7 @@ class PlatformAutoGen(AutoGen):
             return BuildOptions\r
 \r
         for Key in Options:\r
-            if ModuleStyle != None and len (Key) > 2:\r
+            if ModuleStyle is not None and len (Key) > 2:\r
                 # Check Module style is EDK or EDKII.\r
                 # Only append build option for the matched style module.\r
                 if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:\r
@@ -2736,7 +2736,7 @@ class PlatformAutoGen(AutoGen):
                             BuildOptions[Tool][Attr] += " " + Value\r
                         else:\r
                             BuildOptions[Tool][Attr] = Value\r
-        if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:\r
+        if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag is not None:\r
             #\r
             # Override UNI flag only for EDK module.\r
             #\r
@@ -2942,7 +2942,7 @@ class ModuleAutoGen(AutoGen):
 \r
     # Macros could be used in build_rule.txt (also Makefile)\r
     def _GetMacros(self):\r
-        if self._Macro == None:\r
+        if self._Macro is None:\r
             self._Macro = sdict()\r
             self._Macro["WORKSPACE"             ] = self.WorkspaceDir\r
             self._Macro["MODULE_NAME"           ] = self.Name\r
@@ -2982,7 +2982,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the module build data object\r
     def _GetModule(self):\r
-        if self._Module == None:\r
+        if self._Module is None:\r
             self._Module = self.Workspace.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]\r
         return self._Module\r
 \r
@@ -3038,8 +3038,8 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Check if the module is library or not\r
     def _IsLibrary(self):\r
-        if self._LibraryFlag == None:\r
-            if self.Module.LibraryClass != None and self.Module.LibraryClass != []:\r
+        if self._LibraryFlag is None:\r
+            if self.Module.LibraryClass is not None and self.Module.LibraryClass != []:\r
                 self._LibraryFlag = True\r
             else:\r
                 self._LibraryFlag = False\r
@@ -3051,7 +3051,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the directory to store intermediate files of the module\r
     def _GetBuildDir(self):\r
-        if self._BuildDir == None:\r
+        if self._BuildDir is None:\r
             self._BuildDir = path.join(\r
                                     self.PlatformInfo.BuildDir,\r
                                     self.Arch,\r
@@ -3063,15 +3063,15 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the directory to store the intermediate object files of the mdoule\r
     def _GetOutputDir(self):\r
-        if self._OutputDir == None:\r
+        if self._OutputDir is None:\r
             self._OutputDir = path.join(self.BuildDir, "OUTPUT")\r
             CreateDirectory(self._OutputDir)\r
         return self._OutputDir\r
 \r
     ## Return the directory to store ffs file\r
     def _GetFfsOutputDir(self):\r
-        if self._FfsOutputDir == None:\r
-            if GlobalData.gFdfParser != None:\r
+        if self._FfsOutputDir is None:\r
+            if GlobalData.gFdfParser is not None:\r
                 self._FfsOutputDir = path.join(self.PlatformInfo.BuildDir, "FV", "Ffs", self.Guid + self.Name)\r
             else:\r
                 self._FfsOutputDir = ''\r
@@ -3079,21 +3079,21 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the directory to store auto-gened source files of the mdoule\r
     def _GetDebugDir(self):\r
-        if self._DebugDir == None:\r
+        if self._DebugDir is None:\r
             self._DebugDir = path.join(self.BuildDir, "DEBUG")\r
             CreateDirectory(self._DebugDir)\r
         return self._DebugDir\r
 \r
     ## Return the path of custom file\r
     def _GetCustomMakefile(self):\r
-        if self._CustomMakefile == None:\r
+        if self._CustomMakefile is None:\r
             self._CustomMakefile = {}\r
             for Type in self.Module.CustomMakefile:\r
                 if Type in gMakeTypeMap:\r
                     MakeType = gMakeTypeMap[Type]\r
                 else:\r
                     MakeType = 'nmake'\r
-                if self.SourceOverrideDir != None:\r
+                if self.SourceOverrideDir is not None:\r
                     File = os.path.join(self.SourceOverrideDir, self.Module.CustomMakefile[Type])\r
                     if not os.path.exists(File):\r
                         File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])\r
@@ -3194,7 +3194,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list    The token list of the dependency expression after parsed\r
     #\r
     def _GetDepexTokenList(self):\r
-        if self._DepexList == None:\r
+        if self._DepexList is None:\r
             self._DepexList = {}\r
             if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:\r
                 return self._DepexList\r
@@ -3230,7 +3230,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list    The token list of the dependency expression after parsed\r
     #\r
     def _GetDepexExpressionTokenList(self):\r
-        if self._DepexExpressionList == None:\r
+        if self._DepexExpressionList is None:\r
             self._DepexExpressionList = {}\r
             if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:\r
                 return self._DepexExpressionList\r
@@ -3298,7 +3298,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     dict            The dict containing valid options\r
     #\r
     def _GetModuleBuildOption(self):\r
-        if self._BuildOption == None:\r
+        if self._BuildOption is None:\r
             self._BuildOption, self.BuildRuleOrder = self.PlatformInfo.ApplyBuildOption(self.Module)\r
             if self.BuildRuleOrder:\r
                 self.BuildRuleOrder = ['.%s' % Ext for Ext in self.BuildRuleOrder.split()]\r
@@ -3309,7 +3309,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list            The include path list\r
     #\r
     def _GetBuildOptionIncPathList(self):\r
-        if self._BuildOptionIncPathList == None:\r
+        if self._BuildOptionIncPathList is None:\r
             #\r
             # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT\r
             # is the former use /I , the Latter used -I to specify include directories\r
@@ -3370,7 +3370,7 @@ class ModuleAutoGen(AutoGen):
     #  $(CONF_DIRECTORY)/build_rule.txt and toolchain family.\r
     #\r
     def _GetSourceFileList(self):\r
-        if self._SourceFileList == None:\r
+        if self._SourceFileList is None:\r
             self._SourceFileList = []\r
             for F in self.Module.Sources:\r
                 # match tool chain\r
@@ -3423,7 +3423,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the list of unicode files\r
     def _GetUnicodeFileList(self):\r
-        if self._UnicodeFileList == None:\r
+        if self._UnicodeFileList is None:\r
             if TAB_UNICODE_FILE in self.FileTypes:\r
                 self._UnicodeFileList = self.FileTypes[TAB_UNICODE_FILE]\r
             else:\r
@@ -3432,7 +3432,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the list of vfr files\r
     def _GetVfrFileList(self):\r
-        if self._VfrFileList == None:\r
+        if self._VfrFileList is None:\r
             if TAB_VFR_FILE in self.FileTypes:\r
                 self._VfrFileList = self.FileTypes[TAB_VFR_FILE]\r
             else:\r
@@ -3441,7 +3441,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Return the list of Image Definition files\r
     def _GetIdfFileList(self):\r
-        if self._IdfFileList == None:\r
+        if self._IdfFileList is None:\r
             if TAB_IMAGE_FILE in self.FileTypes:\r
                 self._IdfFileList = self.FileTypes[TAB_IMAGE_FILE]\r
             else:\r
@@ -3455,7 +3455,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list            The list of files which can be built later\r
     #\r
     def _GetBinaryFiles(self):\r
-        if self._BinaryFileList == None:\r
+        if self._BinaryFileList is None:\r
             self._BinaryFileList = []\r
             for F in self.Module.Binaries:\r
                 if F.Target not in ['COMMON', '*'] and F.Target != self.BuildTarget:\r
@@ -3465,7 +3465,7 @@ class ModuleAutoGen(AutoGen):
         return self._BinaryFileList\r
 \r
     def _GetBuildRules(self):\r
-        if self._BuildRules == None:\r
+        if self._BuildRules is None:\r
             BuildRules = {}\r
             BuildRuleDatabase = self.PlatformInfo.BuildRule\r
             for Type in BuildRuleDatabase.FileTypeList:\r
@@ -3492,7 +3492,7 @@ class ModuleAutoGen(AutoGen):
         return self._BuildRules\r
 \r
     def _ApplyBuildRule(self, File, FileType):\r
-        if self._BuildTargets == None:\r
+        if self._BuildTargets is None:\r
             self._IntroBuildTargetList = set()\r
             self._FinalBuildTargetList = set()\r
             self._BuildTargets = {}\r
@@ -3517,7 +3517,7 @@ class ModuleAutoGen(AutoGen):
             if Source != File:\r
                 CreateDirectory(Source.Dir)\r
 \r
-            if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:\r
+            if File.IsBinary and File == Source and self._BinaryFileList is not None and File in self._BinaryFileList:\r
                 # Skip all files that are not binary libraries\r
                 if not self.IsLibrary:\r
                     continue\r
@@ -3569,7 +3569,7 @@ class ModuleAutoGen(AutoGen):
             FileType = TAB_UNKNOWN_FILE\r
 \r
     def _GetTargets(self):\r
-        if self._BuildTargets == None:\r
+        if self._BuildTargets is None:\r
             self._IntroBuildTargetList = set()\r
             self._FinalBuildTargetList = set()\r
             self._BuildTargets = {}\r
@@ -3616,7 +3616,7 @@ class ModuleAutoGen(AutoGen):
         if self.BuildType == 'UEFI_HII':\r
             UniStringAutoGenC = False\r
             IdfStringAutoGenC = False\r
-        if self._AutoGenFileList == None:\r
+        if self._AutoGenFileList is None:\r
             self._AutoGenFileList = {}\r
             AutoGenC = TemplateString()\r
             AutoGenH = TemplateString()\r
@@ -3639,29 +3639,29 @@ class ModuleAutoGen(AutoGen):
                 AutoFile = PathClass(gAutoGenStringFileName % {"module_name":self.Name}, self.DebugDir)\r
                 self._AutoGenFileList[AutoFile] = str(StringH)\r
                 self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)\r
-            if UniStringBinBuffer != None and UniStringBinBuffer.getvalue() != "":\r
+            if UniStringBinBuffer is not None and UniStringBinBuffer.getvalue() != "":\r
                 AutoFile = PathClass(gAutoGenStringFormFileName % {"module_name":self.Name}, self.OutputDir)\r
                 self._AutoGenFileList[AutoFile] = UniStringBinBuffer.getvalue()\r
                 AutoFile.IsBinary = True\r
                 self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)\r
-            if UniStringBinBuffer != None:\r
+            if UniStringBinBuffer is not None:\r
                 UniStringBinBuffer.close()\r
             if str(StringIdf) != "":\r
                 AutoFile = PathClass(gAutoGenImageDefFileName % {"module_name":self.Name}, self.DebugDir)\r
                 self._AutoGenFileList[AutoFile] = str(StringIdf)\r
                 self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)\r
-            if IdfGenBinBuffer != None and IdfGenBinBuffer.getvalue() != "":\r
+            if IdfGenBinBuffer is not None and IdfGenBinBuffer.getvalue() != "":\r
                 AutoFile = PathClass(gAutoGenIdfFileName % {"module_name":self.Name}, self.OutputDir)\r
                 self._AutoGenFileList[AutoFile] = IdfGenBinBuffer.getvalue()\r
                 AutoFile.IsBinary = True\r
                 self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)\r
-            if IdfGenBinBuffer != None:\r
+            if IdfGenBinBuffer is not None:\r
                 IdfGenBinBuffer.close()\r
         return self._AutoGenFileList\r
 \r
     ## Return the list of library modules explicitly or implicityly used by this module\r
     def _GetLibraryList(self):\r
-        if self._DependentLibraryList == None:\r
+        if self._DependentLibraryList is None:\r
             # only merge library classes and PCD for non-library module\r
             if self.IsLibrary:\r
                 self._DependentLibraryList = []\r
@@ -3683,7 +3683,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list                    The list of PCD\r
     #\r
     def _GetModulePcdList(self):\r
-        if self._ModulePcdList == None:\r
+        if self._ModulePcdList is None:\r
             # apply PCD settings from platform\r
             self._ModulePcdList = self.PlatformInfo.ApplyPcdSetting(self.Module, self.Module.Pcds)\r
             self.UpdateComments(self._PcdComments, self.Module.PcdComments)\r
@@ -3694,7 +3694,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list                    The list of PCD\r
     #\r
     def _GetLibraryPcdList(self):\r
-        if self._LibraryPcdList == None:\r
+        if self._LibraryPcdList is None:\r
             Pcds = sdict()\r
             if not self.IsLibrary:\r
                 # get PCDs from dependent libraries\r
@@ -3716,7 +3716,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     dict    The mapping between GUID cname and its value\r
     #\r
     def _GetGuidList(self):\r
-        if self._GuidList == None:\r
+        if self._GuidList is None:\r
             self._GuidList = sdict()\r
             self._GuidList.update(self.Module.Guids)\r
             for Library in self.DependentLibraryList:\r
@@ -3726,7 +3726,7 @@ class ModuleAutoGen(AutoGen):
         return self._GuidList\r
 \r
     def GetGuidsUsedByPcd(self):\r
-        if self._GuidsUsedByPcd == None:\r
+        if self._GuidsUsedByPcd is None:\r
             self._GuidsUsedByPcd = sdict()\r
             self._GuidsUsedByPcd.update(self.Module.GetGuidsUsedByPcd())\r
             for Library in self.DependentLibraryList:\r
@@ -3737,7 +3737,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     dict    The mapping between protocol cname and its value\r
     #\r
     def _GetProtocolList(self):\r
-        if self._ProtocolList == None:\r
+        if self._ProtocolList is None:\r
             self._ProtocolList = sdict()\r
             self._ProtocolList.update(self.Module.Protocols)\r
             for Library in self.DependentLibraryList:\r
@@ -3751,7 +3751,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     dict    The mapping between PPI cname and its value\r
     #\r
     def _GetPpiList(self):\r
-        if self._PpiList == None:\r
+        if self._PpiList is None:\r
             self._PpiList = sdict()\r
             self._PpiList.update(self.Module.Ppis)\r
             for Library in self.DependentLibraryList:\r
@@ -3765,7 +3765,7 @@ class ModuleAutoGen(AutoGen):
     #   @retval     list                    The list path\r
     #\r
     def _GetIncludePathList(self):\r
-        if self._IncludePathList == None:\r
+        if self._IncludePathList is None:\r
             self._IncludePathList = []\r
             if self.AutoGenVersion < 0x00010005:\r
                 for Inc in self.Module.Includes:\r
@@ -3957,7 +3957,7 @@ class ModuleAutoGen(AutoGen):
             return\r
             \r
         # Skip the following code for modules with no source files\r
-        if self.SourceFileList == None or self.SourceFileList == []:\r
+        if self.SourceFileList is None or self.SourceFileList == []:\r
             return\r
 \r
         # Skip the following code for modules without any binary files\r
@@ -4172,7 +4172,7 @@ class ModuleAutoGen(AutoGen):
                         HexFormat = '0x%016x'\r
                     PcdValue = HexFormat % int(Pcd.DefaultValue, 0)\r
                 else:\r
-                    if Pcd.MaxDatumSize == None or Pcd.MaxDatumSize == '':\r
+                    if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize == '':\r
                         EdkLogger.error("build", AUTOGEN_ERROR,\r
                                         "Unknown [MaxDatumSize] of PCD [%s.%s]" % (Pcd.TokenSpaceGuidCName, TokenCName)\r
                                         )\r
@@ -4452,7 +4452,7 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Summarize the ModuleAutoGen objects of all libraries used by this module\r
     def _GetLibraryAutoGenList(self):\r
-        if self._LibraryAutoGenList == None:\r
+        if self._LibraryAutoGenList is None:\r
             self._LibraryAutoGenList = []\r
             for Library in self.DependentLibraryList:\r
                 La = ModuleAutoGen(\r
@@ -4540,7 +4540,7 @@ class ModuleAutoGen(AutoGen):
         return True\r
 \r
     def GetTimeStampPath(self):\r
-        if self._TimeStampPath == None:\r
+        if self._TimeStampPath is None:\r
             self._TimeStampPath = os.path.join(self.MakeFileDir, 'AutoGenTimeStamp')\r
         return self._TimeStampPath\r
     def CreateTimeStamp(self, Makefile):\r