From f84108af54268a9e0823c1c110f185a6f9c7a17d Mon Sep 17 00:00:00 2001 From: Android Tools Maintainers Date: Thu, 28 Jul 2022 17:01:55 +0100 Subject: [PATCH] Fix python interpreter name Forwarded: not-needed Gbp-Pq: Topic art Gbp-Pq: Name python3-gen_mterp.patch --- art/runtime/interpreter/mterp/common/gen_setup.py | 2 +- art/runtime/interpreter/mterp/gen_mterp.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/art/runtime/interpreter/mterp/common/gen_setup.py b/art/runtime/interpreter/mterp/common/gen_setup.py index 2684ab25..ac0606b4 100644 --- a/art/runtime/interpreter/mterp/common/gen_setup.py +++ b/art/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/art/runtime/interpreter/mterp/gen_mterp.py b/art/runtime/interpreter/mterp/gen_mterp.py index 5d259557..8534e994 100755 --- a/art/runtime/interpreter/mterp/gen_mterp.py +++ b/art/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"^%( *)") -- 2.30.2