Skip to content

Commit 4763402

Browse files
committed
Fix logging in mx_graalpython
1 parent 38ef0e0 commit 4763402

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,9 +2524,13 @@ def inner(*args, **kwargs):
25242524

25252525
def run(args, *splat, **kwargs):
25262526
if not mx.get_opts().quiet:
2527-
env = kwargs.get("env", os.environ)
2528-
extra_env = shlex.join([f"{k}={v}" for k, v in env.items() if os.environ.get(k) != v])
2529-
mx.log(mx.colorize(f"Running: {extra_env} {shlex.join(args)}", color="green"))
2527+
msg = "Running: "
2528+
env = kwargs.get("env")
2529+
if env:
2530+
extra_env = shlex.join([f"{k}={v}" for k, v in env.items() if os.environ.get(k) != v])
2531+
msg += f'{extra_env} '
2532+
msg += shlex.join(args)
2533+
mx.log(mx.colorize(msg, color="green"))
25302534
return mx.run(args, *splat, **kwargs)
25312535

25322536

0 commit comments

Comments
 (0)