I'd change this line to:

```python
try:
    kwargs.update(self.get_extra_context())
except TypeError:
    raise TypeError('extra_context must be a dictionary or container of two-tuples')
else:
    return kwargs
```