]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / ValidCheckingInfoObject.py
index edd40a1498ffd4ffc8c5d6247d087479127c22d1..ad8c9b598025891f9d77347361ac1ed54926b0fd 100644 (file)
@@ -1,11 +1,5 @@
 # Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 #\r
 # This file is used to collect the Variable checking information\r
@@ -41,7 +35,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
             os.mkdir(dest)\r
         BinFileName = "PcdVarCheck.bin"\r
         BinFilePath = os.path.join(dest, BinFileName)\r
-        Buffer = ''\r
+        Buffer = bytearray()\r
         index = 0\r
         for var_check_tab in self.var_check_info:\r
             index += 1\r
@@ -57,7 +51,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
                 itemIndex += 1\r
                 realLength += 5\r
                 for v_data in item.data:\r
-                    if type(v_data) in (int, long):\r
+                    if isinstance(v_data, int):\r
                         realLength += item.StorageWidth\r
                     else:\r
                         realLength += item.StorageWidth\r
@@ -137,7 +131,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
                 Buffer += b\r
                 realLength += 1\r
                 for v_data in item.data:\r
-                    if type(v_data) in (int, long):\r
+                    if isinstance(v_data, int):\r
                         b = pack(PACK_CODE_BY_SIZE[item.StorageWidth], v_data)\r
                         Buffer += b\r
                         realLength += item.StorageWidth\r