File: python3-gen_mterp.patch

package info (click to toggle)
android-platform-art 10.0.0%2Br36-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,308 kB
  • sloc: cpp: 488,455; java: 151,268; asm: 29,126; python: 9,122; sh: 5,840; ansic: 4,161; xml: 2,846; perl: 77; makefile: 57
file content (45 lines) | stat: -rw-r--r-- 1,564 bytes parent folder | download
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
diff --git a/runtime/interpreter/mterp/common/gen_setup.py b/runtime/interpreter/mterp/common/gen_setup.py
index 2684ab2..ac0606b 100644
--- a/runtime/interpreter/mterp/common/gen_setup.py
+++ b/runtime/interpreter/mterp/common/gen_setup.py
@@ -19,7 +19,7 @@
 # the templated snippets. Those define all the helper functions used below.
 
 import sys, re
-from cStringIO import StringIO
+from io import StringIO
 
 out = StringIO()  # File-like in-memory buffer.
 handler_size_bytes = "MTERP_HANDLER_SIZE"
diff --git a/runtime/interpreter/mterp/gen_mterp.py b/runtime/interpreter/mterp/gen_mterp.py
index 5d25955..8534e99 100755
--- a/runtime/interpreter/mterp/gen_mterp.py
+++ b/runtime/interpreter/mterp/gen_mterp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2016 The Android Open Source Project
 #
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 import sys, re, os
-from cStringIO import StringIO
+from io import StringIO
 
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 # This file is included verbatim at the start of the in-memory python script.
@@ -37,9 +37,9 @@ def getOpcodeList():
   opcode_fp.close()
 
   if len(opcodes) != NUM_PACKED_OPCODES:
-    print "ERROR: found %d opcodes in Interp.h (expected %d)" \
-        % (len(opcodes), NUM_PACKED_OPCODES)
-    raise SyntaxError, "bad opcode count"
+    print("ERROR: found %d opcodes in Interp.h (expected %d)" \
+        % (len(opcodes), NUM_PACKED_OPCODES))
+    raise SyntaxError("bad opcode count")
   return opcodes
 
 indent_re = re.compile(r"^%( *)")