From 8c7d7ac8f97bdd59f5dcd2d9fcd75d6af2107a81 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 0dbb90b..d6591e6 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 @@ -91,7 +91,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)