env.py 文件源码

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

项目:kolibri 作者: learningequality 项目源码 文件源码
def get_cext_path(dist_path):
    """
    Get the directory of dist/cext.
    """
    # Python version of current platform
    python_version = 'cp' + str(sys.version_info.major) + str(sys.version_info.minor)
    dirname = os.path.join(dist_path, 'cext/' + python_version)

    platform = util.get_platform()
    # For Linux system with cpython<3.3, there could be abi tags 'm' and 'mu'
    if 'linux' in platform and int(python_version[2:]) < 33:
        dirname = os.path.join(dirname, 'linux')
        # encode with ucs2
        if sys.maxunicode == 65535:
            dirname = os.path.join(dirname, python_version+'m')
        # encode with ucs4
        else:
            dirname = os.path.join(dirname, python_version+'mu')

    elif 'macosx' in platform:
        platform = 'macosx'
    dirname = os.path.join(dirname, platform)
    sys.path = [os.path.realpath(str(dirname))] + sys.path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号