gpginterface.py 文件源码

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

项目:alicloud-duplicity 作者: aliyun 项目源码 文件源码
def _as_child(self, process, gnupg_commands, args):
        """Stuff run after forking in child"""
        # child
        for std in _stds:
            p = process._pipes[std]
            os.dup2(p.child, getattr(sys, "__%s__" % std).fileno())

        for k, p in process._pipes.items():
            if p.direct and k not in _stds:
                # we want the fh to stay open after execing
                fcntl.fcntl(p.child, fcntl.F_SETFD, 0)

        fd_args = []

        for k, p in process._pipes.items():
            # set command-line options for non-standard fds
            if k not in _stds:
                fd_args.extend([_fd_options[k], "%d" % p.child])

            if not p.direct:
                os.close(p.parent)

        command = [self.call] + fd_args + self.options.get_args() + gnupg_commands + args

        os.execvp(command[0], command)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号