public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2/master PATCH 1/1] GenFds: Compatibility with Python 3.9
@ 2020-12-18 20:15 D. Olsson
  2020-12-22  0:46 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 8+ messages in thread
From: D. Olsson @ 2020-12-18 20:15 UTC (permalink / raw)
  To: devel; +Cc: Dick Olsson

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@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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-23  2:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 20:15 [edk2/master PATCH 1/1] GenFds: Compatibility with Python 3.9 D. Olsson
2020-12-22  0:46 ` 回复: [edk2-devel] " gaoliming
2020-12-22  1:58   ` Bob Feng
2020-12-22  2:06     ` 回复: " gaoliming
2020-12-22 21:59     ` Bret Barkelew
2020-12-22 22:31       ` D. Olsson
2020-12-23  1:35         ` Bob Feng
2020-12-23  2:21           ` Bret Barkelew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox