aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-07 12:47:11 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-07 12:47:11 +0000
commit1380aa04a6c3681a232046058f4388f3bce904ae (patch)
tree9650337a0e4bcccb9a73cdc11e83bd6e3e42511e /lib
parentd59fc41fbaf6ae3458a5260fb53916468f7e56f7 (diff)
downloadruby-1380aa04a6c3681a232046058f4388f3bce904ae.tar.gz
Support old versions of Ruby with FrozenError.
They should work separatedly from Ruby core repository. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/ostruct.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 8cf1233a79..67ba043535 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -156,7 +156,8 @@ class OpenStruct
begin
@modifiable = true
rescue
- raise FrozenError, "can't modify frozen #{self.class}", caller(3)
+ exception_class = defined?(FrozenError) ? FrozenError : RuntimeError
+ raise exception_class, "can't modify frozen #{self.class}", caller(3)
end
@table
end