它有两个目的.
jackcogdill has given the first one.个
它被用来提出你自己的错误.
if something:
raise Exception('My error!')
第二种方法是在异常处理程序中重新释放current个异常,以便可以在调用堆栈的更上层处理它.
try:
generate_exception()
except SomeException as e:
if not can_handle(e):
raise
handle_exception(e)