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
评论列表
文章目录