import yaml


def config_to_yaml(filename):
    """Try to return a yaml object from the config at filename.

    If the file doesn't exist, return None. All other exceptions not caught.
    """
    try:
        with open(filename) as conf_file:
            return yaml.safe_load(conf_file)
    except IOError:
        return None