diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-03-02 22:35:22 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-05 15:02:06 +1000 |
commit | def76fe4d9bbc2c342594dc05861b24d7165d274 (patch) | |
tree | d04ad778e2421de0a85835227ba5bcb08562ec24 /py/objobject.c | |
parent | 85858e72dfdc3e941c2e620e94de05ad663138b1 (diff) | |
download | micropython-def76fe4d9bbc2c342594dc05861b24d7165d274.tar.gz micropython-def76fe4d9bbc2c342594dc05861b24d7165d274.zip |
all: Use MP_ERROR_TEXT for all error messages.
Diffstat (limited to 'py/objobject.c')
-rw-r--r-- | py/objobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objobject.c b/py/objobject.c index 62a3366b55..00082dfe08 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -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_TypeError("arg must be user-type"); + mp_raise_TypeError(MP_ERROR_TEXT("arg must be user-type")); } // This executes only "__new__" part of instance creation. // TODO: This won't work well for classes with native bases. @@ -65,7 +65,7 @@ STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, MP_ROM_PTR(&object__ #if MICROPY_PY_DELATTR_SETATTR STATIC mp_obj_t object___setattr__(mp_obj_t self_in, mp_obj_t attr, mp_obj_t value) { if (!mp_obj_is_instance_type(mp_obj_get_type(self_in))) { - mp_raise_TypeError("arg must be user-type"); + mp_raise_TypeError(MP_ERROR_TEXT("arg must be user-type")); } if (!mp_obj_is_str(attr)) { @@ -80,7 +80,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(object___setattr___obj, object___setattr__); STATIC mp_obj_t object___delattr__(mp_obj_t self_in, mp_obj_t attr) { if (!mp_obj_is_instance_type(mp_obj_get_type(self_in))) { - mp_raise_TypeError("arg must be user-type"); + mp_raise_TypeError(MP_ERROR_TEXT("arg must be user-type")); } if (!mp_obj_is_str(attr)) { @@ -89,7 +89,7 @@ STATIC mp_obj_t object___delattr__(mp_obj_t self_in, mp_obj_t attr) { mp_obj_instance_t *self = MP_OBJ_TO_PTR(self_in); if (mp_map_lookup(&self->members, attr, MP_MAP_LOOKUP_REMOVE_IF_FOUND) == NULL) { - mp_raise_msg(&mp_type_AttributeError, "no such attribute"); + mp_raise_msg(&mp_type_AttributeError, MP_ERROR_TEXT("no such attribute")); } return mp_const_none; } |