summaryrefslogtreecommitdiff
path: root/dev-libs/udis86/files/udis86-1.7.2-python3.patch
blob: b708072195c55ab2006e1f22b926d5bbced362c4 (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
--- a/scripts/ud_opcode.py
+++ b/scripts/ud_opcode.py
@@ -130,8 +130,8 @@
             '/mod'   : lambda v: '00' if v == '!11' else '01',
             # Mode extensions:
             # (16, 32, 64) => (00, 01, 02)
-            '/o'     : lambda v: "%02x" % (int(v) / 32),
-            '/a'     : lambda v: "%02x" % (int(v) / 32),
+            '/o'     : lambda v: "%02x" % (int(v) // 32),
+            '/a'     : lambda v: "%02x" % (int(v) // 32),
             '/m'     : lambda v: '00' if v == '!64' else '01',
             # SSE
             '/sse'   : lambda v: UdOpcodeTables.OpcExtIndex['sse'][v],
@@ -227,7 +227,7 @@
 
     def print_table( self, table, pfxs ):
         print("%s   |" % pfxs)
-        keys = table[ 'entries' ].keys()
+        keys = list(table[ 'entries' ].keys())
         if ( len( keys ) ):
             keys.sort()
         for idx in keys:
--- a/tests/oprgen.py
+++ b/tests/oprgen.py
@@ -686,7 +686,7 @@
     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 @@
                 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