diff options
author | Damien George <damien.p.george@gmail.com> | 2015-09-03 23:14:06 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-09-03 23:14:06 +0100 |
commit | 821b7f22fec342cf0b1b61d959e6c07b9543c696 (patch) | |
tree | e5585b0625c7c1d440df768b233a0afd9ddfa9e6 | |
parent | 25afc7da0db43754f6b4373a10b66551dd3cbd57 (diff) | |
download | micropython-821b7f22fec342cf0b1b61d959e6c07b9543c696.tar.gz micropython-821b7f22fec342cf0b1b61d959e6c07b9543c696.zip |
py: Use mp_not_implemented consistently for not implemented features.
-rw-r--r-- | py/argcheck.c | 3 | ||||
-rw-r--r-- | py/objarray.c | 3 | ||||
-rw-r--r-- | py/objstr.c | 5 | ||||
-rw-r--r-- | py/objstrunicode.c | 3 | ||||
-rw-r--r-- | py/objtuple.c | 3 |
5 files changed, 6 insertions, 11 deletions
diff --git a/py/argcheck.c b/py/argcheck.c index 1be576d578..e7744067c6 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -146,7 +146,6 @@ NORETURN void mp_arg_error_terse_mismatch(void) { #if MICROPY_CPYTHON_COMPAT NORETURN void mp_arg_error_unimpl_kw(void) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, - "keyword argument(s) not yet implemented - use normal args instead")); + mp_not_implemented("keyword argument(s) not yet implemented - use normal args instead"); } #endif diff --git a/py/objarray.c b/py/objarray.c index b14ad5a653..f5ea794044 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -365,8 +365,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value } else if (MP_OBJ_IS_TYPE(index_in, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(o->len, index_in, &slice)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, - "only slices with step=1 (aka None) are supported")); + mp_not_implemented("only slices with step=1 (aka None) are supported"); } if (value != MP_OBJ_SENTINEL) { #if MICROPY_PY_ARRAY_SLICE_ASSIGN diff --git a/py/objstr.c b/py/objstr.c index 4a0705af37..274e76daaa 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -391,8 +391,7 @@ STATIC mp_obj_t bytes_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self_len, index, &slice)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, - "only slices with step=1 (aka None) are supported")); + mp_not_implemented("only slices with step=1 (aka None) are supported"); } return mp_obj_new_str_of_type(type, self_data + slice.start, slice.stop - slice.start); } @@ -975,7 +974,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa arg = key_elem->value; } if (*lookup) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, "attributes not supported yet")); + mp_not_implemented("attributes not supported yet"); } vstr_free(field_name); field_name = NULL; diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 0bb6e045ee..1744925142 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -178,8 +178,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { mp_obj_t ostart, ostop, ostep; mp_obj_slice_get(index, &ostart, &ostop, &ostep); if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, - "only slices with step=1 (aka None) are supported")); + mp_not_implemented("only slices with step=1 (aka None) are supported"); } const byte *pstart, *pstop; diff --git a/py/objtuple.c b/py/objtuple.c index 2fd1815863..9aac1ce4d6 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -183,8 +183,7 @@ mp_obj_t mp_obj_tuple_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) { mp_bound_slice_t slice; if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, - "only slices with step=1 (aka None) are supported")); + mp_not_implemented("only slices with step=1 (aka None) are supported"); } mp_obj_tuple_t *res = mp_obj_new_tuple(slice.stop - slice.start, NULL); mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t); |