posix.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:slug 作者: xonsh 项目源码 文件源码
def start(self):
        """
        Start the process.
        """
        preexec = None
        if hasattr(self, '_process_group_leader'):
            # This probably needs some kind of syncronization...
            if self._process_group_leader is ...:
                preexec = os.setpgrp
            else:
                pgid = self._process_group_leader.pid

                def preexec():
                    os.setpgid(0, pgid)

        self._proc = subprocess.Popen(
            # What to execute
            self.cmd,
            preexec_fn=preexec,
            # What IO it has
            stdin=self.stdin, stdout=self.stdout, stderr=self.stderr,
            # Environment it executes in
            cwd=self.cwd, env=self.environ,
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号