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.
This commit is contained in:
@@ -198,7 +198,7 @@ mp_obj_t mp_obj_float_binary_op(mp_uint_t op, mp_float_t lhs_val, mp_obj_t rhs_i
|
||||
case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE:
|
||||
if (rhs_val == 0) {
|
||||
zero_division_error:
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_ZeroDivisionError, "division by zero"));
|
||||
mp_raise_msg(&mp_type_ZeroDivisionError, "division by zero");
|
||||
}
|
||||
// Python specs require that x == (x//y)*y + (x%y) so we must
|
||||
// call divmod to compute the correct floor division, which
|
||||
|
||||
Reference in New Issue
Block a user