Skip to content

Commit 1f4ca0b

Browse files
committed
run 2to3
1 parent 326914f commit 1f4ca0b

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ def import_python_sources(args):
854854
855855
7. Run the tests and fix any remaining issues.
856856
""".format(mapping))
857-
raw_input("Got it?")
857+
input("Got it?")
858858

859859
cpy_files = []
860860
pypy_files = []
@@ -918,9 +918,9 @@ def import_python_sources(args):
918918

919919
# commit and check back
920920
SUITE.vc.git_command(SUITE.dir, ["add", "."])
921-
raw_input("Check that the updated files look as intended, then press RETURN...")
921+
input("Check that the updated files look as intended, then press RETURN...")
922922
SUITE.vc.commit(SUITE.dir, "Update Python inlined files: %s" % import_version)
923-
answer = raw_input("Should we push python-import (y/N)? ")
923+
answer = input("Should we push python-import (y/N)? ")
924924
if answer and answer in "Yy":
925925
SUITE.vc.git_command(SUITE.dir, ["push", "origin", "python-import:python-import"])
926926
SUITE.vc.update(SUITE.dir, rev=tip)

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,32 @@ def is_sandboxed_configuration(conf):
8181

8282
@contextmanager
8383
def environ(env):
84-
def _handle_var((k, v)):
84+
def _handle_var(key_value):
85+
(k, v) = key_value
8586
if v is None:
8687
del os.environ[k]
8788
else:
8889
os.environ[k] = str(v)
8990

9091
if env:
9192
prev_env = {v: os.getenv(v) for v in env}
92-
map(_handle_var, env.items())
93+
list(map(_handle_var, list(env.items())))
9394
else:
9495
prev_env = None
9596

9697
try:
9798
yield
9899
finally:
99100
if prev_env:
100-
map(_handle_var, prev_env.items())
101+
list(map(_handle_var, list(prev_env.items())))
101102

102103

103104
# ----------------------------------------------------------------------------------------------------------------------
104105
#
105106
# the vm definitions
106107
#
107108
# ----------------------------------------------------------------------------------------------------------------------
108-
class AbstractPythonVm(Vm):
109-
__metaclass__ = ABCMeta
110-
109+
class AbstractPythonVm(Vm, metaclass=ABCMeta):
111110
def __init__(self, config_name, options=None, env=None):
112111
super(AbstractPythonVm, self).__init__()
113112
self._config_name = config_name
@@ -155,9 +154,7 @@ def run(self, cwd, args):
155154
return ret_code, out.data
156155

157156

158-
class AbstractPythonIterationsControlVm(AbstractPythonVm):
159-
__metaclass__ = ABCMeta
160-
157+
class AbstractPythonIterationsControlVm(AbstractPythonVm, metaclass=ABCMeta):
161158
def __init__(self, config_name, options=None, env=None, iterations=None):
162159
super(AbstractPythonIterationsControlVm, self).__init__(config_name, options=options, env=env)
163160
try:
@@ -420,7 +417,7 @@ def createVmCommandLineArgs(self, benchmarks, bmSuiteArgs):
420417
for pth in self._python_path:
421418
if hasattr(pth, '__call__'):
422419
pth = pth()
423-
assert isinstance(pth, (str, unicode))
420+
assert isinstance(pth, str)
424421
python_path.append(pth)
425422
cmd_args += ['-p', ",".join(python_path)]
426423

@@ -434,7 +431,7 @@ def createVmCommandLineArgs(self, benchmarks, bmSuiteArgs):
434431
return vm_options + vm_args + cmd_args
435432

436433
def benchmarkList(self, bm_suite_args):
437-
return self._benchmarks.keys()
434+
return list(self._benchmarks.keys())
438435

439436
def benchmarks(self):
440437
raise FutureWarning('the benchmarks method has been deprecated for VmBenchmarkSuite instances, '

0 commit comments

Comments
 (0)