all: Use MP_ERROR_TEXT for all error messages.

This commit is contained in:
Jim Mussared
2020-03-02 22:35:22 +11:00
committed by Damien George
parent 85858e72df
commit def76fe4d9
192 changed files with 823 additions and 919 deletions

View File

@@ -201,13 +201,13 @@ mp_obj_t mp_obj_complex_binary_op(mp_binary_op_t op, mp_float_t lhs_real, mp_flo
}
case MP_BINARY_OP_FLOOR_DIVIDE:
case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE:
mp_raise_TypeError("can't truncate-divide a complex number");
mp_raise_TypeError(MP_ERROR_TEXT("can't truncate-divide a complex number"));
case MP_BINARY_OP_TRUE_DIVIDE:
case MP_BINARY_OP_INPLACE_TRUE_DIVIDE:
if (rhs_imag == 0) {
if (rhs_real == 0) {
mp_raise_msg(&mp_type_ZeroDivisionError, "complex divide by zero");
mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("complex divide by zero"));
}
lhs_real /= rhs_real;
lhs_imag /= rhs_real;
@@ -235,7 +235,7 @@ mp_obj_t mp_obj_complex_binary_op(mp_binary_op_t op, mp_float_t lhs_real, mp_flo
if (rhs_imag == 0 && rhs_real >= 0) {
lhs_real = (rhs_real == 0);
} else {
mp_raise_msg(&mp_type_ZeroDivisionError, "0.0 to a complex power");
mp_raise_msg(&mp_type_ZeroDivisionError, MP_ERROR_TEXT("0.0 to a complex power"));
}
} else {
mp_float_t ln1 = MICROPY_FLOAT_C_FUN(log)(abs1);