Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python print traceback when error occurs in a class

# Add a dunder function __exit__
def __exit__(self, exc_type, exc_value, traceback):
   print("
within __exit__")
   print("
Traceback:", traceback)
 
PREVIOUS NEXT
Tagged: #Python #print #traceback #error #occurs #class
ADD COMMENT
Topic
Name
4+1 =