_filefinder2.py 文件源码

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

项目:filefinder2 作者: asmodehn 项目源码 文件源码
def find_module(cls, fullname, path=None):
            """find the module on sys.path or 'path' based on sys.path_hooks and
            sys.path_importer_cache.
            This method is for python2 only
            """
            spec = cls.find_spec(fullname, path)
            if spec is None:
                return None
            elif spec.loader is None and spec.submodule_search_locations:
                # Here we need to create a namespace loader to handle namespaces since python2 doesn't...
                return NamespaceLoader2(spec.name, spec.submodule_search_locations)
            else:
                return spec.loader
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号