]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / GenFdsGlobalVariable.py
index 97e20753ae9b540ec79e5158f4cea105095f8fa1..fcb191981c95a75489a4134cc51392eaab41cea2 100644 (file)
@@ -229,7 +229,7 @@ class GenFdsGlobalVariable:
                 Source = SourceList[Index]\r
                 Index = Index + 1\r
     \r
-                if File.IsBinary and File == Source and Inf.Binaries != None and File in Inf.Binaries:\r
+                if File.IsBinary and File == Source and Inf.Binaries is not None and File in Inf.Binaries:\r
                     # Skip all files that are not binary libraries\r
                     if not Inf.LibraryClass:\r
                         continue            \r
@@ -420,7 +420,7 @@ class GenFdsGlobalVariable:
         if not os.path.exists(Output):\r
             return True\r
         # always update "Output" if no "Input" given\r
-        if Input == None or len(Input) == 0:\r
+        if Input is None or len(Input) == 0:\r
             return True\r
 \r
         # if fdf file is changed after the 'Output" is generated, update the 'Output'\r
@@ -445,9 +445,9 @@ class GenFdsGlobalVariable:
             Cmd += ["-s", Type]\r
         if CompressionType not in [None, '']:\r
             Cmd += ["-c", CompressionType]\r
-        if Guid != None:\r
+        if Guid is not None:\r
             Cmd += ["-g", Guid]\r
-        if DummyFile != None:\r
+        if DummyFile is not None:\r
             Cmd += ["--dummy", DummyFile]\r
         if GuidHdrLen not in [None, '']:\r
             Cmd += ["-l", GuidHdrLen]\r
@@ -455,7 +455,7 @@ class GenFdsGlobalVariable:
             #Add each guided attribute\r
             for Attr in GuidAttr:\r
                 Cmd += ["-r", Attr]\r
-        if InputAlign != None:\r
+        if InputAlign is not None:\r
             #Section Align is only for dummy section without section type\r
             for SecAlign in InputAlign:\r
                 Cmd += ["--sectionalign", SecAlign]\r
@@ -509,7 +509,7 @@ class GenFdsGlobalVariable:
 \r
     @staticmethod\r
     def GetAlignment (AlignString):\r
-        if AlignString == None:\r
+        if AlignString is None:\r
             return 0\r
         if AlignString in ("1K", "2K", "4K", "8K", "16K", "32K", "64K", "128K", "256K", "512K"):\r
             return int (AlignString.rstrip('K')) * 1024\r
@@ -669,13 +669,13 @@ class GenFdsGlobalVariable:
             return\r
         GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, InputList))\r
                         \r
-        if ClassCode != None:\r
+        if ClassCode is not None:\r
             Cmd += ["-l", ClassCode]\r
-        if Revision != None:\r
+        if Revision is not None:\r
             Cmd += ["-r", Revision]\r
-        if DeviceId != None:\r
+        if DeviceId is not None:\r
             Cmd += ["-i", DeviceId]\r
-        if VendorId != None:\r
+        if VendorId is not None:\r
             Cmd += ["-f", VendorId]\r
 \r
         Cmd += ["-o", Output]\r
@@ -726,7 +726,7 @@ class GenFdsGlobalVariable:
             EdkLogger.error("GenFds", COMMAND_FAILURE, ExtraData="%s: %s" % (str(X), cmd[0]))\r
         (out, error) = PopenObject.communicate()\r
 \r
-        while PopenObject.returncode == None :\r
+        while PopenObject.returncode is None :\r
             PopenObject.wait()\r
         if returnValue != [] and returnValue[0] != 0:\r
             #get command return value\r
@@ -758,7 +758,7 @@ class GenFdsGlobalVariable:
     #   @param  MacroDict     Dictionary that contains macro value pair\r
     #\r
     def MacroExtend (Str, MacroDict={}, Arch='COMMON'):\r
-        if Str == None :\r
+        if Str is None :\r
             return None\r
 \r
         Dict = {'$(WORKSPACE)'   : GenFdsGlobalVariable.WorkSpaceDir,\r
@@ -774,7 +774,7 @@ class GenFdsGlobalVariable:
 \r
         Dict['$(OUTPUT_DIRECTORY)'] = OutputDir\r
 \r
-        if MacroDict != None  and len (MacroDict) != 0:\r
+        if MacroDict is not None  and len (MacroDict) != 0:\r
             Dict.update(MacroDict)\r
 \r
         for key in Dict.keys():\r
@@ -794,7 +794,7 @@ class GenFdsGlobalVariable:
     #   @param  PcdPattern           pattern that labels a PCD.\r
     #\r
     def GetPcdValue (PcdPattern):\r
-        if PcdPattern == None :\r
+        if PcdPattern is None :\r
             return None\r
         PcdPair = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')\r
         TokenSpace = PcdPair[0]\r