mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
udis86: use python3 for the build/tests. (#10122)
Patches for Python 3 compatibility, taken from: https://salsa.debian.org/debian/libudis86/-/tree/master/debian/patches
This commit is contained in:
54
dev-libs/udis86/patches/0002-Fix-oprgen-python3-compat.patch
Normal file
54
dev-libs/udis86/patches/0002-Fix-oprgen-python3-compat.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From: Robert Haist <rhaist@mailbox.org>
|
||||
Date: Mon, 14 May 2018 22:58:01 +0200
|
||||
Subject: Fix oprgen python3 compat
|
||||
|
||||
---
|
||||
tests/oprgen.py | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/oprgen.py b/tests/oprgen.py
|
||||
index 9ab7634..f8a038d 100644
|
||||
--- a/tests/oprgen.py
|
||||
+++ b/tests/oprgen.py
|
||||
@@ -103,10 +103,10 @@ class UdTestGenerator( ud_opcode.UdOpcodeTables ):
|
||||
|
||||
def Xmm(self):
|
||||
r = 16 if self.mode == 64 else 8
|
||||
- return "xmm%d" % random.choice(range(r))
|
||||
+ return "xmm%d" % random.choice(list(range(r)))
|
||||
|
||||
def Mmx(self):
|
||||
- return "mm%d" % random.choice(range(8))
|
||||
+ return "mm%d" % random.choice(list(range(8)))
|
||||
|
||||
def Modrm_RM_GPR(self, size, cast=False):
|
||||
return random.choice([self.Gpr(size),
|
||||
@@ -208,8 +208,8 @@ class UdTestGenerator( ud_opcode.UdOpcodeTables ):
|
||||
|
||||
def Opr_R(self):
|
||||
if self.mode == 64:
|
||||
- return self.OprRxq(random.choice(range(8)))
|
||||
- return self.OprRxd(random.choice(range(8)));
|
||||
+ return self.OprRxq(random.choice(list(range(8))))
|
||||
+ return self.OprRxd(random.choice(list(range(8))));
|
||||
|
||||
def Opr_C(self):
|
||||
return "cr3"
|
||||
@@ -686,7 +686,7 @@ class UdTestGenerator( ud_opcode.UdOpcodeTables ):
|
||||
def generate_yasm( self, mode, seed ):
|
||||
opr_combos = {}
|
||||
random.seed( seed )
|
||||
- print "[bits %s]" % mode
|
||||
+ print("[bits %s]" % mode)
|
||||
for insn in self.InsnTable:
|
||||
if insn[ 'mnemonic' ] in self.ExcludeList:
|
||||
continue
|
||||
@@ -728,7 +728,7 @@ class UdTestGenerator( ud_opcode.UdOpcodeTables ):
|
||||
else:
|
||||
operands = None
|
||||
if operands is not None:
|
||||
- print "\t%s %s" % (insn['mnemonic'], operands)
|
||||
+ print("\t%s %s" % (insn['mnemonic'], operands))
|
||||
opr_combos[fusedName]['covered'] = True
|
||||
|
||||
# stats
|
||||
Reference in New Issue
Block a user