should be:

```python
except NotImplementedError as ex:
```

The syntax is clearer, and forwards-compatible with Python 3.