首页 > 代码库 > python exception的传递
python exception的传递
try:
block
except1:
except2:
...
如果block中出现了except,那么会先取匹配except1,如果匹配了,进行处理,程序继续执行。
如果except1没有匹配上,那么继续匹配except2。
如果该层的try except都没有匹配到,那么就会去外层的try except去匹配,直到匹配到为止。
python exception的传递
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。