Play nicely with python exception hierarchy