py: Use mp_raise_msg helper function where appropriate.
Saves the following number of bytes of code space: 176 for bare-arm, 352
for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266.
diff --git a/py/objcomplex.c b/py/objcomplex.c
index 5da655e..96be252 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -197,7 +197,7 @@
case MP_BINARY_OP_INPLACE_TRUE_DIVIDE:
if (rhs_imag == 0) {
if (rhs_real == 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ZeroDivisionError, "complex division by zero"));
+ mp_raise_msg(&mp_type_ZeroDivisionError, "complex division by zero");
}
lhs_real /= rhs_real;
lhs_imag /= rhs_real;
@@ -226,7 +226,7 @@
lhs_real = 1;
rhs_real = 0;
} else {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ZeroDivisionError, "0.0 to a complex power"));
+ mp_raise_msg(&mp_type_ZeroDivisionError, "0.0 to a complex power");
}
} else {
mp_float_t ln1 = MICROPY_FLOAT_C_FUN(log)(abs1);