From c6558c8c468fffe3d9f457d2576a176ea1066a95 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Mon, 26 Aug 2024 17:42:36 +0300 Subject: [PATCH] bytebeat_compiler.py: make use of `shlex.join` When printing a command that is going to be ran, use `shlex.join(...)` instead of `" ".join(...)` --- bytebeat_compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 89e19c8..c6065ee 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -6,7 +6,7 @@ if __name__ == "__main__": from argparse import ArgumentParser from os import environ, makedirs, name as os_name from os.path import exists, join as path_join -from shlex import split as command_line_split +from shlex import join as command_line_join, split as command_line_split from shutil import which from sys import stdin, stdout, exit from typing import Dict, Union @@ -90,7 +90,7 @@ def substitute_vars(replacements: Dict[str, Union[bool, str]], text: str, return text def run_command(*command: list[str]) -> None: - print(" ".join(command), flush=True) + print(command_line_join(command), flush=True) if subprocess.run(command).returncode != EXIT_SUCCESS: exit(EXIT_FAILURE)