init.py 文件源码

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

项目:s2e-env 作者: S2E 项目源码 文件源码
def _get_ubuntu_version():
    """
    Gets the "major" Ubuntu version.

    If an unsupported OS/Ubuntu version is found a warning is printed and
    ``None`` is returned.
    """
    import platform

    distname, version, _ = platform.dist()

    if distname.lower() != 'ubuntu':
        logger.warning('You are running on a non-Ubuntu system. Skipping S2E '
                       'dependencies - please install them manually')
        return None

    major_version = int(version.split('.')[0])

    if major_version not in CONSTANTS['required_versions']['ubuntu_major_ver']:
        logger.warning('You are running an unsupported version of Ubuntu. '
                       'Skipping S2E dependencies  - please install them '
                       'manually')
        return None

    return major_version
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号