audk/BaseTools/Source/Python/Common
Cole Robinson 43bec9ea3d BaseTools: Work around array.array.tostring() removal in python 3.9
In python3, array.array.tostring() was a compat alias for tobytes().
tostring() was removed in python 3.9.

Convert this to use tolist() which should be valid for all python
versions.

This fixes this build error on python3.9:

(Python 3.9.0b5 on linux) Traceback (most recent call last):
  File "/root/edk2/edk2-edk2-stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Trim.py", line 593, in Main
    GenerateVfrBinSec(CommandOptions.ModuleName, CommandOptions.DebugDir, CommandOptions.OutputFile)
  File "/root/edk2/edk2-edk2-stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Trim.py", line 449, in GenerateVfrBinSec
    VfrUniOffsetList = GetVariableOffset(MapFileName, EfiFileName, VfrNameList)
  File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 88, in GetVariableOffset
    return _parseForGCC(lines, efifilepath, varnames)
  File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 151, in _parseForGCC
    efisecs = PeImageClass(efifilepath).SectionHeaderList
  File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 1638, in __init__
    if ByteArray.tostring() != b'PE\0\0':
AttributeError: 'array.array' object has no attribute 'tostring'

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-08-14 02:21:18 +00:00
..
Edk2 BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Uefi BaseTools/Capsule: Add capsule dependency support 2020-01-15 03:16:46 +00:00
BuildToolError.py BaseTools:Add the spare space FV image size checker 2020-04-23 01:29:34 +00:00
BuildVersion.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
DataType.py BaseTools: BaseTools changes for RISC-V platform. 2020-04-29 02:52:08 +00:00
EdkLogger.py BaseTools: Enable block queue log agent. 2019-08-09 23:15:55 +08:00
Expression.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
GlobalData.py BaseTools: Add Guid name support in GenFfs. 2020-07-17 05:25:41 +00:00
LongFilePathOs.py BaseTools:Introduce CopyFileOnChange() function to copy cache files 2019-06-17 17:00:46 +08:00
LongFilePathOsPath.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
LongFilePathSupport.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Misc.py BaseTools: Work around array.array.tostring() removal in python 3.9 2020-08-14 02:21:18 +00:00
MultipleWorkspace.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Parsing.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
RangeExpression.py BaseTools:change some incorrect parameter defaults 2019-09-17 10:18:51 +08:00
StringUtils.py BaseTools:change some incorrect parameter defaults 2019-09-17 10:18:51 +08:00
TargetTxtClassObject.py BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption 2020-01-13 02:08:46 +00:00
ToolDefClassObject.py BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption 2020-01-13 02:08:46 +00:00
VariableAttributes.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
VpdInfoFile.py BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
caching.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00