def METHOD_NAME(base, module, name):
    try:
        real_type = base(module, name)
    except (ImportError, AttributeError):
        error_occured.append(True)
        return dummy
    if module.split(".")[0] not in ("quodlibet", "tests"):
        return real_type
    # return a straight dict subclass so that unpickle doesn't call
    # our __setitem__. Further down we simply change the __class__
    # to our real type.
    if not real_type in temp_type_cache:
        new_type = type(name, (dict,), {"real_type": real_type})
        temp_type_cache[real_type] = new_type
    return temp_type_cache[real_type]