def shell_command()

in understanding_rl_vision/svelte3/compiling.py [0:0]


def shell_command(command, **kwargs):
    """Wrapper around subprocess.check_output. Should be used with care:
    https://docs.python.org/3/library/subprocess.html#security-considerations
    """
    try:
        return subprocess.check_output(
            command,
            stderr=subprocess.STDOUT,
            shell=True,
            universal_newlines=True,
            **kwargs
        ).strip("\n")
    except subprocess.CalledProcessError as exn:
        raise CompileError(
            "Command '%s' failed with output:\n\n%s" % (command, exn.output)
        ) from exn