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.web12.8901.1603093889869959247 for ; Mon, 19 Oct 2020 00:51:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 19 Oct 2020 15:51:26 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'fengyunhua'" , Cc: References: <000201d6a102$ba711cf0$2f5356d0$@byosoft.com.cn> In-Reply-To: <000201d6a102$ba711cf0$2f5356d0$@byosoft.com.cn> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0hdIEJhc2VUb29sczogYXJyYXkuZnJvbXN0cmluZyBhbmQgYXJyYXkudG9zdHJpbmcgcmVtb3ZlZCBpbiBweXRob24gMy45?= Date: Mon, 19 Oct 2020 15:51:25 +0800 Message-ID: <004301d6a5ec$a5981240$f0c836c0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGoLEzrCTmHWriyvkuuMIZ+MdwgYqn7gF7w Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: fengyunhua > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = 2020=E5=B9=B410=E6=9C=8813=E6=97=A5 9:47 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > =E6=8A=84=E9=80=81: bob.c.feng@intel.com; gaoliming@byosoft.com.cn > =E4=B8=BB=E9=A2=98: [PATCH] BaseTools: array.fromstring and = array.tostring removed in > python 3.9 >=20 > array.fromstring and array.tostring deprecated, and alias for > array.frombytes and array.tobytes. Deprecated since version 3.2, > have been removed in version python 3.9. >=20 > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Yunhua Feng > --- > BaseTools/Source/Python/Eot/EotMain.py | 10 > +++++----- > BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 4 ++-- > 2 files changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Eot/EotMain.py > b/BaseTools/Source/Python/Eot/EotMain.py > index 791fcdfeae..08bb2de172 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) > + DecData.frombytes(TmpData) > except: > TmpData =3D DeCompress('Framework', > self[self._HEADER_SIZE_:]) > DecData =3D array('B') > - DecData.fromstring(TmpData) > + DecData.frombytes(TmpData) >=20 > SectionList =3D [] > Offset =3D 0 > @@ -196,7 +196,7 @@ class Ui(Image): > return len(self) >=20 > def _GetUiString(self): > - return codecs.utf_16_decode(self[0:-2].tostring())[0] > + return codecs.utf_16_decode(self[0:-2].tobytes())[0] >=20 > String =3D property(_GetUiString) >=20 > @@ -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) > + DecData.frombytes(TmpData) > 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) > + DecData.frombytes(TmpData) > Offset =3D 0 > while Offset < len(DecData): > Sec =3D Section() > diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > index dc1727c466..124dc43199 100644 > --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > @@ -463,12 +463,12 @@ class GenFdsGlobalVariable: > GenFdsGlobalVariable.SecCmdList.append(' > '.join(Cmd).strip()) > else: > SectionData =3D array('B', [0, 0, 0, 0]) > - SectionData.fromstring(Ui.encode("utf_16_le")) > + SectionData.frombytes(Ui.encode("utf_16_le")) > SectionData.append(0) > SectionData.append(0) > Len =3D len(SectionData) >=20 > GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & = 0xff, > (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15) > - SaveFileOnChange(Output, SectionData.tostring()) > + SaveFileOnChange(Output, SectionData.tobytes()) >=20 > elif Ver: > Cmd +=3D ("-n", Ver) > -- > 2.27.0.windows.1 >=20