code: def re_execute_with_exception(frame, exception, traceback):
      
      if sys.gettrace() == globaltrace:
          # If our trace handler is already installed, that means that this
          # function has been called twice before the line tracer had a chance to
          # run. That can happen if more than one exception was logged.
          return
  
      call_lineno = frame.f_lineno
  
      def intercept_next_line(f, why, *args):
          if f is not frame:
              return
          set_linetrace_on_frame(f)
          # Undo modifications to the callers code (ick ick ick)
          back_like_nothing_happened()
          # Raise exception in (almost) the perfect place (except for duplication)
          if sys.version_info[0] < 3:
              #raise exception.__class__, exception, traceback
              raise exception
          raise exception.with_traceback(traceback)
  
      set_linetrace_on_frame(frame, intercept_next_line)
  
      linestarts = list(dis.findlinestarts(frame.f_code))
      linestarts = [a for a, l in linestarts if l >= call_lineno]
  
      # Jump target
      dest = linestarts[0]
  
      oc = frame.f_code.co_code[frame.f_lasti]
      if sys.version_info[0] < 3:
          oc = ord(oc)
      opcode_size = 2 if oc >= opcode.HAVE_ARGUMENT else 0
      # Opcode to overwrite
      where = frame.f_lasti + 1 + opcode_size
  
      #dis.disco(frame.f_code)
      pc = PyCodeObject.from_address(id(frame.f_code))
      back_like_nothing_happened = pc.co_code.contents.inject_jump(where, dest)
      #print("#"*100)
      #dis.disco(frame.f_code)
  
      sys.settrace(globaltrace)
docs: Dark magic. Causes ``frame`` to raise an exception at the current location
      with ``traceback`` appended to it.
  
      Note that since the line tracer is raising an exception, the interpreter
      disables the global trace, so it's not possible to restore the previous
      tracing conditions.