code: def internal_change_variable(dbg, seq, thread_id, frame_id, scope, attr, value):
      ''' Changes the value of a variable '''
      try:
          frame = dbg.find_frame(thread_id, frame_id)
          if frame is not None:
              result = pydevd_vars.change_attr_expression(frame, attr, value, dbg)
          else:
              result = None
          xml = "<xml>"
          xml += pydevd_xml.var_to_xml(result, "")
          xml += "</xml>"
          cmd = dbg.cmd_factory.make_variable_changed_message(seq, xml)
          dbg.writer.add_command(cmd)
      except Exception:
          cmd = dbg.cmd_factory.make_error_message(seq, "Error changing variable attr:%s expression:%s traceback:%s" % (attr, value, get_exception_traceback_str()))
          dbg.writer.add_command(cmdf internal_change_variable(dbg, seq, thread_id, frame_id, scope, attr, value):
      ''' Changes the value of a variable '''
      try:
          frame = dbg.find_frame(thread_id, frame_id)
          if frame is not None:
              result = pydevd_vars.change_attr_expression(frame, attr, value, dbg)
          else:
              result = None
          xml = "<xml>"
          xml += pydevd_xml.var_to_xml(result, "")
          xml += "</xml>"
          cmd = dbg.cmd_factory.make_variable_changed_message(seq, xml)
          dbg.writer.add_command(cmd)
      except Exception:
          cmd = dbg.cmd_factory.make_error_message(seq, "Error changing variable attr:%s expression:%s traceback:%s" % (attr, value, get_exception_traceback_str()))
          dbg.writer.add_command(cmd)
docs: Changes the value of a variable