diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-06 02:45:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-06 02:45:14 +0000 |
commit | 6a482c7f8b1cd7b7015f585831a41f5a182b2024 (patch) | |
tree | c99b43a863b3fe1e066d7eb95d04c88796e072c0 /lib | |
parent | 6e12d9647928cdd2e894ec4c4999a60eee51b6b0 (diff) | |
download | ruby-6a482c7f8b1cd7b7015f585831a41f5a182b2024.tar.gz |
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.rb | 1 |
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 |