'except Class as e' has been backported as far as 2.6, so let's use that