summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/drb/drb.rb3
-rw-r--r--lib/mathn.rb1
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ec72651bb..1a32ddcd31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,6 +130,11 @@ Sun Jun 18 00:49:11 2006 Tanaka Akira <akr@m17n.org>
(unix_recvfrom_nonblock): removed.
UNIXSocket#recvfrom_nonblock is removed.
+Sat Jun 17 22:17:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/mathn.rb (Integer::prime_division): raise ZeroDivisionError
+ on zeros. [ruby-dev:28739]
+
Sat Jun 17 14:53:32 2006 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb: backport from 1.9.
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 2177af871b..dac7a9b02c 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -430,12 +430,15 @@ module DRb
end
end
+ # An exception wrapping an error object
class DRbRemoteError < DRbError
def initialize(error)
@reason = error.class.to_s
super("#{error.message} (#{error.class})")
set_backtrace(error.backtrace)
end
+
+ # the class of the error, as a string.
attr_reader :reason
end
diff --git a/lib/mathn.rb b/lib/mathn.rb
index 14e2e9272c..a5a121c6c6 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -43,6 +43,7 @@ class Integer
end
def prime_division
+ raise ZeroDivisionError if self == 0
ps = Prime.new
value = self
pv = []