Beispiel #1
0
def raw_cmd(arguments, shell=False, **kwargs):
    """
    Launch a subprocess.

    This function ensure that:

    * subprocess arguments will be converted to a string if `shell` is True
    * subprocess.args is set to the arguments of the subprocess
    """
    arguments_list = to_args_list(arguments)
    process = Popen(to_args_string(arguments_list) if shell else arguments_list, shell=shell, **kwargs)
    if not hasattr(process, "args"):
        process.args = arguments_list
    return process
def raw_cmd(arguments, shell=False, **kwargs):
    """
    Launch a subprocess.

    This function ensure that:

    * subprocess arguments will be converted to a string if `shell` is True
    * subprocess.args is set to the arguments of the subprocess
    """
    arguments = to_args_list(arguments)
    process = Popen(to_args_string(arguments) if shell else arguments,
                    shell=shell,
                    **kwargs)
    if not hasattr(process, 'args'):
        process.args = arguments
    return process