def _pg_run(args, env=None, stdout=PIPE):
    try:
        p = Popen(args, env=env, stdout=stdout, stderr=STDOUT)
        stdout, _ = p.communicate()
        if p.returncode != 0:
            raise Exception("command failed: %s\nOUTPUT:\n%s" % (' '.join(args), stdout))
    except __HOLE__ as exc:
        if exc.errno != errno.ENOENT:
            raise
        # carefully convert a common exception message into something more informative
        raise Exception("""Could not find the binary %s. This is probably because
postgresql executables are not on the path.Try setting the PATH variable
to include the postgresql executables. On Debian Linux with PostgreSQL
you could run PATH=/usr/lib/postgresql/X.Y/bin:$PATH""" % args[0])
    return stdout
dataset/ETHPy150Open jinty/van.pg/van/pg/_cluster.py/_pg_run