def METHOD_NAME(self, etype, value, tb):
    prefix = 'Traceback (most recent call last):\n'
    empty_tb = [prefix, '  None\n']
    if self._full_traceback:
        if tb or value.__context__ or value.__cause__:
            return traceback.format_exception(etype, value, tb)
        else:
            return empty_tb + traceback.format_exception_only(etype, value)
    else:
        if tb:
            return [prefix] + traceback.format_tb(tb)
        else:
            return empty_tb