setupext.py 文件源码

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

项目:SlackBuilds 作者: montagdude 项目源码 文件源码
def check_requirements(self):
        if 'TRAVIS' in os.environ:
            raise CheckFailed("Can't build with Travis")

        # This check needs to be performed out-of-process, because
        # importing gi and then importing regular old pygtk afterward
        # segfaults the interpreter.
        try:
            p = multiprocessing.Pool()
        except:
            return "unknown (can not use multiprocessing to determine)"
        try:
            res = p.map_async(backend_gtk3agg_internal_check, [0])
            success, msg = res.get(timeout=10)[0]
        except multiprocessing.TimeoutError:
            p.terminate()
            # No result returned. Probaly hanging, terminate the process.
            success = False
            raise CheckFailed("Check timed out")
        except:
            p.close()
            # Some other error.
            success = False
            msg = "Could not determine"
            raise
        else:
            p.close()
        finally:
            p.join()

        if success:
            return msg
        else:
            raise CheckFailed(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号