audk/BaseTools/Source/Python
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
..
AmlToC BaseTools: Compile AML bytecode arrays into .obj file 2020-07-02 10:09:17 +00:00
AutoGen BaseTools: fix ucs-2 lookup on python 3.9 2020-08-14 02:21:18 +00:00
BPDG BaseTools: Fix various typos 2019-07-08 08:59:29 +08:00
Capsule BaseTools/Capsule: Add capsule dependency support 2020-01-15 03:16:46 +00:00
Common BaseTools: Work around array.array.tostring() removal in python 3.9 2020-08-14 02:21:18 +00:00
CommonDataClass BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Ecc BaseTools/Ecc: Replace deprecated function time.clock() 2020-05-13 05:52:03 +00:00
Eot BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
GenFds BaseTools: Fix binary file not generate map file issue 2020-07-23 03:03:00 +00:00
GenPatchPcdTable BaseTools: Add map file parsing support for CLANG9 2019-11-08 08:29:36 +08:00
PatchPcdValue BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
Pkcs7Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Rsa2048Sha256Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Table BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
TargetTool BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Trim BaseTools: Warn user the file not found issue instead of break build. 2020-06-07 13:36:33 +00:00
UPT BaseTools: Fix various typos 2019-07-08 08:59:29 +08:00
Workspace BaseTools: Remove the file timestamp checking during parsing 2020-07-21 04:12:32 +00:00
build BaseTools: Move CreateAsBuiltInf into AutoGenWorker for parallel 2020-08-14 01:43:32 +00:00
GNUmakefile BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Makefile BaseTools: strip trailing whitespace 2019-10-04 11:18:22 +01:00
basetool_tiano_python_path_env.yaml BaseTools: Add YAML files with path env and tool extdeps 2019-11-11 13:01:53 -08:00
sitecustomize.py BaseTools: Do not call sys.setdefaultencoding with python 3 2019-10-23 14:25:23 +08:00