Python3 style exception compatibility