setup.py 文件源码

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

项目:atropos 作者: jdidion 项目源码 文件源码
def out_of_date(extensions):
    """
    Check whether any pyx source is newer than the corresponding generated
    C source or whether any C source is missing.
    """
    for extension in extensions:
        for pyx in extension.sources:
            path, ext = os.path.splitext(pyx)
            if ext not in ('.pyx', '.py'):
                continue
            if extension.language == 'c++':
                csource = path + '.cpp'
            else:
                csource = path + '.c'
            # When comparing modification times, allow five seconds slack:
            # If the installation is being run from pip, modification
            # times are not preserved and therefore depends on the order in
            # which files were unpacked.
            if not os.path.exists(csource) or (
                os.path.getmtime(pyx) > os.path.getmtime(csource) + 5):
                return True
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号