code: def get_traceback_stxt():
          
          #/
          exc_cls, exc_obj, tb_obj = sys.exc_info()
          
          #/
          txt_s = traceback.format_exception(exc_cls, exc_obj, tb_obj)
      
          #/
          res = ''.join(txt_s)
      
          return res
docs: Result is (bytes) str type on Python 2 and (unicode) str type on Python 3.