pytorch/third_party/protobuf/ruby/tests/common_tests.rb
# Ruby 2.5 changed to raise FrozenError instead of RuntimeError
Ruby 2.5 changed to raise FrozenError instead of RuntimeError
Ruby 2 . 5 changed to raise FrozenError instead of RuntimeError
def value_from_ruby(value)
    ret = Google::Protobuf::Value.new
    case value
    when String
      ret.string_value = value
    when Google::Protobuf::Struct
      ret.struct_value = value
    when Hash
      ret.struct_value = struct_from_ruby(value)
    when Google::Protobuf::ListValue
      ret.list_value = value
    when Array
      ret.list_value = list_from_ruby(value)
    else
      @log.error "Unknown type: #{value.class}"
      raise Google::Protobuf::Error, "Unknown type: #{value.class}"
    end
    ret
  end
def value_from_ruby ( value ) ret = Google :: Protobuf :: Value . new case value when String ret . string_value = value when Google :: Protobuf :: Struct ret . struct_value = value when Hash ret . struct_value = struct_from_ruby ( value ) when Google :: Protobuf :: ListValue ret . list_value = value when Array ret . list_value = list_from_ruby ( value ) else @log . error "Unknown type: #{value.class}" raise Google :: Protobuf :: Error , "Unknown type: #{value.class}" end ret end
Ruby 2.5 changed to raise FrozenError instead of RuntimeError
Ruby 2 . 5 changed to raise FrozenError instead of RuntimeError
value
<not_specific>