Nov-11-2019, 03:56 PM
Python3 documentation states:
A traceback object is normally created automatically when an exception is raised and attached to it as the __traceback__ attribute, which is writable.
What is the trick to get this traceback or what is wrong into my code.
A traceback object is normally created automatically when an exception is raised and attached to it as the __traceback__ attribute, which is writable.
What is the trick to get this traceback or what is wrong into my code.
import traceback class MyException(Exception): def __init__(self, mymessage): super().__init__ # do special things (print, mymessage) def essai(): raise MyException(' myp message') if __name__ == '__main__': essai()