__init__.py 文件源码

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

项目:compatify 作者: hatooku 项目源码 文件源码
def file_ns_handler(importer, path_item, packageName, module):
    """Compute an ns-package subpath for a filesystem or zipfile importer"""

    subpath = os.path.join(path_item, packageName.split('.')[-1])
    normalized = _normalize_cached(subpath)
    for item in module.__path__:
        if _normalize_cached(item)==normalized:
            break
    else:
        # Only return the path if it's not already there
        return subpath
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号