summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 10:20:53 (GMT)
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 11:04:29 (GMT)
commit3e7d002118a92fad5934e11c75be6768a1476c1b (patch)
treee9f437327b5c743622a97c092ddadc2d99cb0bc5 /rational.c
parentcd069df36596d9bf7a6db8aaa0dcefdafb233a91 (diff)
Check exception flag as a bool [Bug #15987]
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/rational.c b/rational.c
index 207c4c4..e137ac2 100644
--- a/rational.c
+++ b/rational.c
@@ -574,13 +574,7 @@ nurat_f_rational(int argc, VALUE *argv, VALUE klass)
a2 = Qundef;
}
if (!NIL_P(opts)) {
- static ID kwds[1];
- VALUE exception;
- if (!kwds[0]) {
- kwds[0] = idException;
- }
- rb_get_kwargs(opts, kwds, 0, 1, &exception);
- raise = (exception != Qfalse);
+ raise = rb_opts_exception_p(opts, raise);
}
return nurat_convert(rb_cRational, a1, a2, raise);
}