Python 3 style exception handling