异常的构成:
1.异常类
2.异常值
3.追踪信息(解释器捕捉到的)
def __exit__(self, exc_type, exc_val, exc_tb): print(‘do exit‘) print(‘exc_type异常的类:‘,exc_type) print(‘exc_val异常的内容‘,exc_val) print(‘exc_tb异常的追踪:‘,exc_tb)
原文地址:https://www.cnblogs.com/python1988/p/11529905.html
时间: 2024-10-08 11:09:28