def __enter__(self):
# suppress writing of .pyc files:
self.prev_dont_write_bytecode = sys.dont_write_bytecode
sys.dont_write_bytecode = True
if self.cleanup_import_caches:
# remember which modules were already loaded before we run the import.
self._backup_dict(sys.modules, 'modules', run_with_empty = False)
self._backup_dict(sys.path_importer_cache, 'path_importer_cache', run_with_empty = True)
评论列表
文章目录