slackbuilds_ponce/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff
Mario Preksavec b0768026fe
system/xen: Updated for version 4.15.0.
Signed-off-by: Mario Preksavec <mario@slackware.hr>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-08-19 18:33:51 +07:00

60 lines
2.8 KiB
Diff

--- xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/Eot/EotMain.py.orig 2019-06-06 06:51:42.000000000 +0200
+++ xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/Eot/EotMain.py 2020-12-25 20:10:44.332843625 +0100
@@ -152,11 +152,11 @@
try:
TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
DecData = array('B')
- DecData.fromstring(TmpData)
+ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
except:
TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
DecData = array('B')
- DecData.fromstring(TmpData)
+ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
SectionList = []
Offset = 0
@@ -196,7 +196,7 @@
return len(self)
def _GetUiString(self):
- return codecs.utf_16_decode(self[0:-2].tostring())[0]
+ return codecs.utf_16_decode(self[0:-2].tobytes())[0]
String = property(_GetUiString)
@@ -738,7 +738,7 @@
Offset = self.DataOffset - 4
TmpData = DeCompress('Framework', self[self.Offset:])
DecData = array('B')
- DecData.fromstring(TmpData)
+ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
Offset = 0
while Offset < len(DecData):
Sec = Section()
@@ -759,7 +759,7 @@
TmpData = DeCompress('Lzma', self[self.Offset:])
DecData = array('B')
- DecData.fromstring(TmpData)
+ list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData))
Offset = 0
while Offset < len(DecData):
Sec = Section()
--- xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py.orig 2019-06-06 06:51:42.000000000 +0200
+++ xen-ovmf-20190606_20d2e5a125/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2020-12-25 20:10:39.188843812 +0100
@@ -469,12 +469,12 @@
GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
else:
SectionData = 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 = 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)