Skip to content

Commit e57d4d2

Browse files
committed
Remove confusing def python in mx_graalpython
1 parent da9b6c6 commit e57d4d2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ def full_python(args, env=None):
434434
args.insert(0, '--python.WithJavaStacktrace=1')
435435

436436
if "--hosted" in args[:2]:
437-
args.remove("--hosted")
438-
return python(args)
437+
return do_run_python(args)
439438

440439
if '--vm.da' not in args:
441440
args.insert(0, '--vm.ea')
@@ -471,15 +470,13 @@ def handle_debug_arg(args):
471470
f"--vm.agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:{mx._opts.java_dbg_port}")
472471

473472

474-
def python(args, **kwargs):
475-
"""run a Python program or shell"""
476-
if not any(arg.startswith('--python.WithJavaStacktrace') for arg in args):
477-
args.insert(0, '--python.WithJavaStacktrace=1')
478-
479-
do_run_python(args, **kwargs)
473+
def do_run_python(args, extra_vm_args=None, env=None, jdk=None, extra_dists=None, cp_prefix=None, cp_suffix=None, main_class=GRAALPYTHON_MAIN_CLASS, minimal=False, **kwargs):
480474

475+
if "--hosted" in args[:2]:
476+
args.remove("--hosted")
477+
if not any(arg.startswith('--python.WithJavaStacktrace') for arg in args):
478+
args.insert(0, '--python.WithJavaStacktrace=1')
481479

482-
def do_run_python(args, extra_vm_args=None, env=None, jdk=None, extra_dists=None, cp_prefix=None, cp_suffix=None, main_class=GRAALPYTHON_MAIN_CLASS, minimal=False, **kwargs):
483480
if not any(arg.startswith("--python.CAPI") for arg in args):
484481
capi_home = _get_capi_home()
485482
args.insert(0, "--python.CAPI=%s" % capi_home)

0 commit comments

Comments
 (0)