回复: [edk2-devel] [edk2/master PATCH 1/1] GenFds: Compatibility with Python 3.9

gaoliming gaoliming at byosoft.com.cn
Tue Dec 22 00:46:45 UTC 2020


Yunhua and Bob:
  Can you review this patch this week? More and more people reports Python39 fail in BaseTools.

Thanks
Liming
> -----邮件原件-----
> 发件人: bounce+27952+69235+4905953+8761045 at groups.io
> <bounce+27952+69235+4905953+8761045 at groups.io> 代表 D. Olsson via
> groups.io
> 发送时间: 2020年12月19日 4:15
> 收件人: devel at edk2.groups.io
> 抄送: Dick Olsson <hi at senzilla.io>
> 主题: [edk2-devel] [edk2/master PATCH 1/1] GenFds: Compatibility with
> Python 3.9
> 
> Python 3.9 removed the tostring() and fromstring() methods:
> https://docs.python.org/3/whatsnew/3.9.html#removed
> 
> Signed-off-by: Dick Olsson <hi at senzilla.io>
> ---
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 = 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 = len(SectionData)
> 
> GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff,
> (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)
> -                SaveFileOnChange(Output, SectionData.tostring())
> +                SaveFileOnChange(Output, SectionData.tobytes())
> 
>          elif Ver:
>              Cmd += ("-n", Ver)
> --
> 2.25.1
> 
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69352): https://edk2.groups.io/g/devel/message/69352
Mute This Topic: https://groups.io/mt/79139787/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list