PEP 3110 -- Catching Exceptions in Python 3000

Handle exceptions to work well in python3.