def deactivate():
# CAREFUL : Even though we remove the path from sys.path,
# initialized finders will remain in sys.path_importer_cache
# removing metahook
sys.meta_path.pop(get_rospathfinder_index_in_meta_hooks())
# removing path_hook
sys.path_hooks.pop(get_rosdirectoryfinder_index_in_path_hooks())
filefinder2.deactivate()
# Resetting sys.path_importer_cache to get rid of previous importers
sys.path_importer_cache.clear()
评论列表
文章目录