import configparser


def read_section(section, fname):
    """Read the specified section of an .ini file."""
    conf = configparser.ConfigParser()
    conf.read(fname)
    val = {}
    try:
        val = dict((v, k) for v, k in conf.items(section))
        return val
    except configparser.NoSectionError:
        return None