summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-03 14:18:26 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-03 14:18:26 +0000
commit215b8092a7821700baa8b89bac010db721891f99 (patch)
tree18748019eff9d766bc1c627ac6942ac6701c9424
parentb81e04571299a8e98d3931be9c10b9b63da375a8 (diff)
* complex.c (nucomp_real_check): raise TypeError instead of ArgumentError
when argument is not a real as expected [ruby-core:28395] * rational.c (nurat_int_check): ditto (for integers) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--complex.c2
-rw-r--r--rational.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 85d2751da0..e157ef27dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Mar 3 23:16:32 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * complex.c (nucomp_real_check): raise TypeError instead of
+ ArgumentError when argument is not a real as expected
+ [ruby-core:28395]
+
+ * rational.c (nurat_int_check): ditto (for integers)
+
Wed Mar 3 23:07:08 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/matrix.rb (Vector#each): Return self and optimization
diff --git a/complex.c b/complex.c
index 214d3a24ca..67422572df 100644
--- a/complex.c
+++ b/complex.c
@@ -377,7 +377,7 @@ nucomp_real_check(VALUE num)
break;
default:
if (!k_numeric_p(num) || !f_real_p(num))
- rb_raise(rb_eArgError, "not a real");
+ rb_raise(rb_eTypeError, "not a real");
}
}
diff --git a/rational.c b/rational.c
index 65d3cf4a35..f5a6d2655f 100644
--- a/rational.c
+++ b/rational.c
@@ -419,7 +419,7 @@ nurat_int_check(VALUE num)
break;
default:
if (!k_numeric_p(num) || !f_integer_p(num))
- rb_raise(rb_eArgError, "not an integer");
+ rb_raise(rb_eTypeError, "not an integer");
}
}