Add comment about shlex use on Windows

This commit is contained in:
Paul O'Leary McCann 2022-09-02 13:23:18 +09:00
parent 80c276c5f7
commit edfa32da47

View File

@ -965,6 +965,9 @@ def run_command(
RETURNS (Optional[CompletedProcess]): The process object.
"""
if isinstance(command, str):
# On Windows, it's possible for the split here to be different from what
# will actually be used for execution, but it will *usually* be correct,
# and is only used in debugging output if a command failed.
cmd_list = shlex.split(command, posix=True)
cmd_str = command
else: