

def exec_cmd(cmd):
    logging.info('%s', ' '.join(cmd))
    try:
        p = subprocess.Popen(cmd, bufsize=(- 1), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (out, err) = p.communicate()
    except Exception:
        logging.error('%s', err)
        raise
    if p.returncode:
        raise Exception(('%s\n%s%s' % (' '.join(cmd), out, err)))

dataset/ETHPy150Open viewfinderco/viewfinder/__init__.py exec_cmd/original