code: def format_exc_skip(skip, limit=None):
      
      etype, val, tb = sys.exc_info()
      for i in range(skip):
          tb = tb.tb_next
      return (''.join(format_exception(etype, val, tb, limit))).rstrip()
docs: Like traceback.format_exc but allow skipping the first frames.