Improve Python 3 compatibility (remove irregular raise syntax)