Use new-style exception handling syntax

TODO:

- [ ] Fix indentation in the pydispatch sub-module (It's currently a mix of tabs and spaces)