import configparser


def _copy_ini(config: configparser.ConfigParser, section: str, option: str) -> str:
  """Returns the text needed to set the given option.

  If the option isn't set in the old config, this returns the empty string.

  Args:
    config: Old configuration.
    section: Section to copy from.
    option: Option to copy.
  """
  if config.has_option(section, option):
    return '{}={}\n'.format(option, config.get(section, option))
  else:
    return ''