<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def load_config(settings):
    '''Load settings from configfile'''
    config = ConfigParser()
    section = 'pgdocgen'
    try:
        config.read(settings['configfile'])
    except Exception as e:
        sys.stderr.write('Failed to read config: ' + str(e))
        sys.exit(1)
    for option in config.options(section):
        settings[option] = config.get(section, option)
    return settings