def raw_build_sdist(cwd):
    cmd = ["python", "setup.py", "sdist", "--format=zip"]

    build_log = "sdist.log"
    f = open(build_log, 'w')
    try:
        try:
            st = subprocess.call(cmd, #shell = True,
                            stderr = subprocess.STDOUT, stdout = f,
                            cwd=cwd)
            if st:
                raise RuntimeError("The cmd failed with status %d" % st)
        finally:
            f.close()
    except (subprocess.CalledProcessError, __HOLE__), e:
        print e
        msg = """
There was an error while executing the following command:

    %s

Error was : %s

Look at the log (%s).""" % (cmd, str(e), build_log)
        raise Exception(msg)
dataset/ETHPy150Open scipy/scipy/tools/win32/build_scripts/pavement.py/raw_build_sdist