Skip to content

Commit c77359e

Browse files
committed
shlex.join is python 3.8+
1 parent 617ea12 commit c77359e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,15 @@ def is_included(path):
515515

516516
args += [_graalpytest_driver(), "-v"]
517517

518-
agent_args = mx_gate.get_jacoco_agent_args()
518+
agent_args = ' '.join(shlex.quote(arg) for arg in mx_gate.get_jacoco_agent_args() or [])
519519
if agent_args:
520520
# We need to make sure the arguments get passed to subprocesses, so we create a temporary launcher
521521
# with the arguments
522522
new_launcher_path = os.path.join(os.path.dirname(os.path.realpath(python_binary)), 'graalpython-jacoco')
523523
with open(python_binary, 'r', encoding='ascii', errors='ignore') as old_launcher:
524524
lines = old_launcher.readlines()
525525
assert re.match(r'^#!.*bash', lines[0]), "jacoco needs a bash launcher"
526-
lines.insert(-1, f'jvm_args+=({shlex.join(agent_args)})\n')
526+
lines.insert(-1, f'jvm_args+=({agent_args})\n')
527527
with open(new_launcher_path, 'w') as new_launcher:
528528
new_launcher.writelines(lines)
529529
os.chmod(new_launcher_path, 0o755)

0 commit comments

Comments
 (0)