PortalServer.py 文件源码

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

项目:jumpscale_portal 作者: jumpscale7 项目源码 文件源码
def restartInProcess(self, app):
        import fcntl
        args = sys.argv[:]
        args.insert(0, sys.executable)
        apppath = j.system.fs.joinPaths(j.dirs.appDir, app)
        max_fd = 1024
        for fd in range(3, max_fd):
            try:
                flags = fcntl.fcntl(fd, fcntl.F_GETFD)
            except IOError:
                continue
            fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
        os.chdir(apppath)
        os.execv(sys.executable, args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号