]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / PatchPcdValue / PatchPcdValue.py
index 882da81930da267e02ba412fe9c4a69feb5b2bd8..0c8009cb0b44840305a50f57494da1d0963f067d 100644 (file)
@@ -161,10 +161,11 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
             #\r
             # Patch {0x1, 0x2, ...} byte by byte\r
             #\r
-            ValueList = ValueString[1 : len(ValueString) - 1].split(', ')\r
+            ValueList = ValueString[1 : len(ValueString) - 1].split(',')\r
             Index = 0\r
             try:\r
                 for ByteString in ValueList:\r
+                    ByteString = ByteString.strip()\r
                     if ByteString.upper().startswith('0X'):\r
                         ByteValue = int(ByteString, 16)\r
                     else:\r
@@ -266,13 +267,13 @@ def Main():
         if not os.path.exists (InputFile):\r
             EdkLogger.error("PatchPcdValue", FILE_NOT_FOUND, ExtraData=InputFile)\r
             return 1\r
-        if CommandOptions.PcdOffset == None or CommandOptions.PcdValue == None or CommandOptions.PcdTypeName == None:\r
+        if CommandOptions.PcdOffset is None or CommandOptions.PcdValue is None or CommandOptions.PcdTypeName is None:\r
             EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdOffset or PcdValue of PcdTypeName is not specified.")\r
             return 1\r
         if CommandOptions.PcdTypeName.upper() not in ["BOOLEAN", "UINT8", "UINT16", "UINT32", "UINT64", "VOID*"]:\r
             EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData="PCD type %s is not valid." % (CommandOptions.PcdTypeName))\r
             return 1\r
-        if CommandOptions.PcdTypeName.upper() == "VOID*" and CommandOptions.PcdMaxSize == None:\r
+        if CommandOptions.PcdTypeName.upper() == "VOID*" and CommandOptions.PcdMaxSize is None:\r
             EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdMaxSize is not specified for VOID* type PCD.")\r
             return 1\r
         #\r