aboutsummaryrefslogtreecommitdiff
path: root/system/xen/patches/0003-BaseTools-replace-deprecated-fromstring-and-tostring.diff
blob: 4c9f2b6674bbe5868978166817d2a90a8039d725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- 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)