@contextmanager
def protect_preferred_plugins():
 preferred_plugins = manage_plugins.preferred_plugins.copy()
 try:
  (yield)
 finally:
  manage_plugins.preferred_plugins = preferred_plugins

@ contextmanager def protect_preferred_plugins ( ) : preferred_plugins = manage_plugins . preferred_plugins . copy ( ) try : ( yield ) finally : manage_plugins . preferred_plugins = preferred_plugins
contexts where preferred_plugins can be modified w/o side-effects .