original_set_item = HttpResponse.__setitem__

def __setitem__(self, header, value):
    if header == 'Vary':
        raise ValueError
original_set_item(self, header, value)
HttpResponse.__setitem__ = __setitem__
Tracing from an effect back to its cause in a large Python codebase