diff options
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 62a3366b5..00082dfe0 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; } |