aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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