py: Use mp_raise_TypeError/mp_raise_ValueError helpers where possible.
Saves 168 bytes on bare-arm.
This commit is contained in:
@@ -50,7 +50,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___init___obj, object___init__);
|
||||
|
||||
STATIC mp_obj_t object___new__(mp_obj_t cls) {
|
||||
if (!MP_OBJ_IS_TYPE(cls, &mp_type_type) || !mp_obj_is_instance_type((mp_obj_type_t*)MP_OBJ_TO_PTR(cls))) {
|
||||
mp_raise_msg(&mp_type_TypeError, "__new__ arg must be a user-type");
|
||||
mp_raise_TypeError("__new__ arg must be a user-type");
|
||||
}
|
||||
mp_obj_t o = MP_OBJ_SENTINEL;
|
||||
mp_obj_t res = mp_obj_instance_make_new(MP_OBJ_TO_PTR(cls), 1, 0, &o);
|
||||
|
||||
Reference in New Issue
Block a user