def runJob(self, job):
        """submit job to queue.

        This subroutine should only exit if the job completed.
        """
        s = subprocess.Popen(self.getStatement(job),
                             shell=True,
                             stdin=subprocess.PIPE,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE,
                             cwd=os.curdir,
                             close_fds=True)

        (out, err) = s.communicate()

        if s.returncode != 0:
            raise ClusterError(
                "Error while running job %s: %s\n%s\n" % (job, out, err))

        return out, err
dataset/ETHPy150Open CGATOxford/cgat/obsolete/Cluster.py/Cluster.runJob/original