1 import sys 2 try: 3 a = 3 4 assert a > 4 5 except: 6 exc = sys.exc_info()#返回异常的元祖 7 print (exc)
1 import sys 2 try: 3 a = 3 4 assert a > 4 5 except: 6 exc = sys.exc_info()#返回异常的元祖 7 print (exc)
转载于:https://www.cnblogs.com/themost/p/6821040.html