class MyCustomException(Exception):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
self.__suppress_context__ = True
try:
    1 / 0
except ZeroDivisionError as e:
    raise MyCustomException(str(e))
Get only last traceback without using raise from None?