def format_exc(limit=None):
    try:
        etype, value, tb = sys.exc_info()
        return ''.join(format_exception(etype, value, tb, limit))
    finally:
        etype = value = tb = None
Like print_exc() but return a string.
dataset/ETHPy150Open babble/babble/include/jython/Lib/traceback.py/format_exc