#\r
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\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
##\r
PadByte = pack('B', 0xFF)\r
else:\r
PadByte = pack('B', 0)\r
- PadData = ''.join(PadByte for i in xrange(0, Size))\r
- Buffer.write(PadData)\r
+ for i in range(0, Size):\r
+ Buffer.write(PadByte)\r
\r
## AddToBuffer()\r
#\r
if self.FvAddress % FvAlignValue != 0:\r
EdkLogger.error("GenFds", GENFDS_ERROR,\r
"FV (%s) is NOT %s Aligned!" % (FvObj.UiFvName, FvObj.FvAlignment))\r
- FvBuffer = BytesIO('')\r
+ FvBuffer = BytesIO()\r
FvBaseAddress = '0x%X' % self.FvAddress\r
BlockSize = None\r
BlockNum = None\r
else:\r
# region ended within current blocks\r
if self.Offset + self.Size <= End:\r
- ExpectedList.append((BlockSize, (RemindingSize + BlockSize - 1) / BlockSize))\r
+ ExpectedList.append((BlockSize, (RemindingSize + BlockSize - 1) // BlockSize))\r
break\r
# region not ended yet\r
else:\r
UsedBlockNum = BlockNum\r
# region started in middle of current blocks\r
else:\r
- UsedBlockNum = (End - self.Offset) / BlockSize\r
+ UsedBlockNum = (End - self.Offset) // BlockSize\r
Start = End\r
ExpectedList.append((BlockSize, UsedBlockNum))\r
RemindingSize -= BlockSize * UsedBlockNum\r