def _get_not_none(meta, key, none_subst=dict):
    """
    Return meta[key] if key is in meta and its value is not None, otherwise
    return none_subst().

    Some recipes have an empty build section, so it'll be None and we can't
    do a chained get.
    """
    ret = meta.get(key)
    return ret if (ret is not None) else none_subst()