def check_call(*args, **kwargs):
    """Run command with arguments. Wait for command to complete. If the return code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute."""
    rc = call(*args, **kwargs)
    if rc != 0:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = args[0]
        raise CalledProcessError(rc, cmd)
    return 0
Run command with arguments. Wait for command to complete. If the return code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute.
lib/mlpatches/modules/subprocess.py