def _get_section_or_create(config, sectionname):
    """Get a config section, or create and return empty section"""
    try:
        return config[sectionname]
    except KeyError:
        config.add_section(sectionname)
    return config[sectionname]