field_generator.py 文件源码

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

项目:stixmarx 作者: mitre 项目源码 文件源码
def _get_module(module_name):
        """Returns a tuple with all objects that could be instantiated
        without arguments.

        Args:
            module_name: A string object. It represents the name of the top-level module.

        Returns:
            A ModuleType object with all sub-modules imported from the given module.
        """
        top_level_module = importlib.import_module(module_name)

        prefix = modulename(top_level_module) + "."

        try:
            for module_loader, name, is_pkg in pkgutil.walk_packages(path=top_level_module.__path__, prefix=prefix):
                importlib.import_module(name, top_level_module)
        except (ImportError, ImportWarning) as e:
            LOG.debug(str(e))

        return top_level_module
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号