异常的构成:
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)
2024-04-12 23:55:02
异常的构成:
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)