aboutsummaryrefslogtreecommitdiff
path: root/py/modmath.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-03-18 17:26:19 +1100
committerDamien George <damien.p.george@gmail.com>2020-03-18 17:26:19 +1100
commitad9a0ec8abc9d04b93b949831b7152f55ca0d7ac (patch)
treef988445bbb8f1ef36b1ae69bfa6e60f4ed5d3d4e /py/modmath.c
parent8f0778b2092a4af1b7109b997a3c9c14766e31e8 (diff)
all: Convert exceptions to use mp_raise_XXX helpers in remaining places.
Diffstat (limited to 'py/modmath.c')
-rw-r--r--py/modmath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/modmath.c b/py/modmath.c
index 5fe8e498c..52ad0b000 100644
--- a/py/modmath.c
+++ b/py/modmath.c
@@ -294,7 +294,7 @@ STATIC mp_obj_t mp_math_factorial_inner(mp_uint_t start, mp_uint_t end) {
STATIC mp_obj_t mp_math_factorial(mp_obj_t x_obj) {
mp_int_t max = mp_obj_get_int(x_obj);
if (max < 0) {
- mp_raise_msg(&mp_type_ValueError, "negative factorial");
+ mp_raise_ValueError("negative factorial");
} else if (max == 0) {
return MP_OBJ_NEW_SMALL_INT(1);
}
@@ -308,7 +308,7 @@ STATIC mp_obj_t mp_math_factorial(mp_obj_t x_obj) {
STATIC mp_obj_t mp_math_factorial(mp_obj_t x_obj) {
mp_int_t max = mp_obj_get_int(x_obj);
if (max < 0) {
- mp_raise_msg(&mp_type_ValueError, "negative factorial");
+ mp_raise_ValueError("negative factorial");
} else if (max <= 1) {
return MP_OBJ_NEW_SMALL_INT(1);
}