summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/xen-tools/files/xen-tools-4.15.1-edk2-python3.9.patch')
-rw-r--r--app-emulation/xen-tools/files/xen-tools-4.15.1-edk2-python3.9.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/app-emulation/xen-tools/files/xen-tools-4.15.1-edk2-python3.9.patch b/app-emulation/xen-tools/files/xen-tools-4.15.1-edk2-python3.9.patch
new file mode 100644
index 00000000000..a1f8d155434
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-tools-4.15.1-edk2-python3.9.patch
@@ -0,0 +1,26 @@
+diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
+index ad556710802e..4be7957138a5 100755
+--- a/BaseTools/Source/Python/Common/Misc.py
++++ b/BaseTools/Source/Python/Common/Misc.py
+@@ -1635,7 +1635,7 @@ def __init__(self, PeFile):
+ ByteArray = array.array('B')
+ ByteArray.fromfile(PeObject, 4)
+ # PE signature should be 'PE\0\0'
+- if ByteArray.tostring() != b'PE\0\0':
++ if ByteArray.tolist() != [ord('P'), ord('E'), 0, 0]:
+ self.ErrorInfo = self.FileName + ' has no valid PE signature PE00'
+ return
+
+diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py
+index b2895f7e5c63..883c2356e0ca 100644
+--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
++++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
+@@ -152,7 +152,7 @@ def encode(self, input, errors='strict'):
+
+ TheUcs2Codec = Ucs2Codec()
+ def Ucs2Search(name):
+- if name == 'ucs-2':
++ if name in ['ucs-2', 'ucs_2']:
+ return codecs.CodecInfo(
+ name=name,
+ encode=TheUcs2Codec.encode,