Better exception handling on Python 3 (where .message might not be prese...

...nt).