diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-06 03:06:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-06 03:06:11 +0000 |
commit | acc55c25c587fef5c7327c5912f3aa50a969ec34 (patch) | |
tree | c8a1bcb549bc6b3a251a3d2c865c17ec1385acd8 /lib/yaml/rubytypes.rb | |
parent | c31e7c1e8b2895ef33204938487597e2b3acaaf7 (diff) |
merge revision(s) 34919:
* lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
YAML serialization problem for Exception.
Exception#initialize doesn't use visible instance variable for
the exception message, so call the method with the message.
patched by Jingwen Owen Ou <jingweno AT gmail.com>.
http://github.com/ruby/ruby/pull/41
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@34920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/rubytypes.rb')
-rw-r--r-- | lib/yaml/rubytypes.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index 35b719196e..55d59fa03b 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -117,7 +117,8 @@ end class Exception yaml_as "tag:ruby.yaml.org,2002:exception" def Exception.yaml_new( klass, tag, val ) - o = YAML.object_maker( klass, { 'mesg' => val.delete( 'message' ) } ) + o = klass.allocate + Exception.instance_method(:initialize).bind(o).call(val.delete('message')) val.each_pair do |k,v| o.instance_variable_set("@#{k}", v) end |