mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
all: Use MP_ERROR_TEXT for all error messages.
This commit is contained in:
committed by
Damien George
parent
85858e72df
commit
def76fe4d9
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user