From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.9145.1603690803942140611 for ; Sun, 25 Oct 2020 22:40:05 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from LAPTOP2AECFQIA ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 26 Oct 2020 13:39:55 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: fengyunhua@byosoft.com.cn From: "fengyunhua" To: , Cc: "'Bob Feng'" , "'Liming Gao'" , "'Yuwei Chen'" References: <20201023030142.2015-1-mingyuex.liang@intel.com> In-Reply-To: <20201023030142.2015-1-mingyuex.liang@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBCYXNlVG9vbHM6IHJlcGxhY2UgYXJyYXkuZnJvbXN0cmluZyBNZXRob2QgZm9yIHN1cHBvcnRzIHB5LTIgYW5kIHB5LTMu?= Date: Mon, 26 Oct 2020 13:40:00 +0800 Message-ID: <000001d6ab5a$72ab8ce0$5802a6a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQK5Qvxi+ysv896Io6SpqbivPkS6aqfkLOrw Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Array.tostring also should replace -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+66563+5049190+8953120@groups.io = =E4=BB=A3=E8=A1=A8 mliang2x =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B410=E6=9C=8823=E6=97=A5 = 11:02 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E6=8A=84=E9=80=81: Mingyue Liang ; Bob Feng ; Liming Gao ; Yuwei Chen =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH] BaseTools: replace array.fromstri= ng Method for supports py-2 and py-3. Because after Python 3.2, array.fromstring method is renamed frombytes, so it needs to be modified to support python2 and python3 methods. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/Source/Python/Eot/EotMain.py | 8 ++++---- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Pyt= hon/Eot/EotMain.py index 791fcdfeae..2ff68054e6 100644 --- a/BaseTools/Source/Python/Eot/EotMain.py +++ b/BaseTools/Source/Python/Eot/EotMain.py @@ -152,11 +152,11 @@ class CompressedImage(Image): try: TmpData =3D DeCompress('Efi', self[self._HEADER_SIZE_:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData= )) except: TmpData =3D DeCompress('Framework', self[self._HEADER_SIZE_:]= ) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData= )) =20 SectionList =3D [] Offset =3D 0 @@ -738,7 +738,7 @@ class GuidDefinedImage(Image): Offset =3D self.DataOffset - 4 TmpData =3D DeCompress('Framework', self[self.Offset:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), Tmp= Data)) Offset =3D 0 while Offset < len(DecData): Sec =3D Section() @@ -759,7 +759,7 @@ class GuidDefinedImage(Image): =20 TmpData =3D DeCompress('Lzma', self[self.Offset:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), Tmp= Data)) Offset =3D 0 while Offset < len(DecData): Sec =3D Section() diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/Base= Tools/Source/Python/GenFds/GenFdsGlobalVariable.py index dc1727c466..411af80c2b 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -463,7 +463,7 @@ class GenFdsGlobalVariable: GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).= strip()) else: SectionData =3D array('B', [0, 0, 0, 0]) - SectionData.fromstring(Ui.encode("utf_16_le")) + list(map(lambda str: SectionData.fromlist([ord(str), 0]),= Ui)) SectionData.append(0) SectionData.append(0) Len =3D len(SectionData) --=20 2.28.0.windows.1