summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-06 02:45:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-06 02:45:14 +0000
commitd903681a13ef9b25735e0d2ed9fbd16a9465d23d (patch)
treec99b43a863b3fe1e066d7eb95d04c88796e072c0 /lib
parent75ca0646234c3c5d7e1c798101aebe6f51469d52 (diff)
e2mmap.rb: remove old definition
* lib/e2mmap.rb (E2MM.def_exception): remove old definition if exists so that works multiple times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/e2mmap.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb
index e9cbd6a63d..ba1e87dd85 100644
--- a/lib/e2mmap.rb
+++ b/lib/e2mmap.rb
@@ -134,6 +134,7 @@ module Exception2MessageMapper
def E2MM.def_exception(k, n, m, s = StandardError)
e = Class.new(s)
E2MM.instance_eval{@MessageMap[[k, e]] = m}
+ k.module_eval {remove_const(n)} if k.const_defined?(n, false)
k.const_set(n, e)
end