# 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"
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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.
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"^%( *)")