def activate():
"""Install the path-based import components."""
if path_hook not in sys.path_hooks:
sys.path_hooks.append(path_hook)
# Resetting sys.path_importer_cache values,
# to support the case where we have an implicit package inside an already loaded package,
# since we need to replace the default importer.
sys.path_importer_cache.clear()
if PathFinder2 not in sys.meta_path:
# Setting up the meta_path to change package finding logic
sys.meta_path.append(PathFinder2)
评论列表
文章目录