Correct name of mp_raise_NotImplementedError to make error name.

This commit is contained in:
Scott Shawcroft 2017-02-24 16:46:38 +01:00
parent 35071b3681
commit 75d6abe3bb
16 changed files with 23 additions and 23 deletions

View File

@ -34,7 +34,7 @@
void common_hal_nativeio_touchin_construct(nativeio_touchin_obj_t* self, void common_hal_nativeio_touchin_construct(nativeio_touchin_obj_t* self,
const mcu_pin_obj_t *pin) { const mcu_pin_obj_t *pin) {
mp_raise_NotImplementError("No capacitive touch support"); mp_raise_NotImplementedError("No capacitive touch support");
} }
void common_hal_nativeio_touchin_deinit(nativeio_touchin_obj_t* self) { void common_hal_nativeio_touchin_deinit(nativeio_touchin_obj_t* self) {

View File

@ -1025,7 +1025,7 @@ STATIC mp_obj_t lwip_socket_sendall(mp_obj_t self_in, mp_obj_t buf_in) {
break; break;
} }
case MOD_NETWORK_SOCK_DGRAM: case MOD_NETWORK_SOCK_DGRAM:
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
break; break;
} }

View File

@ -153,7 +153,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) {
mp_obj_t s = mp_obj_new_str(subj.begin, caps[0] - subj.begin, false); mp_obj_t s = mp_obj_new_str(subj.begin, caps[0] - subj.begin, false);
mp_obj_list_append(retval, s); mp_obj_list_append(retval, s);
if (self->re.sub > 0) { if (self->re.sub > 0) {
mp_raise_NotImplementError("Splitting with sub-captures"); mp_raise_NotImplementedError("Splitting with sub-captures");
} }
subj.begin = caps[1]; subj.begin = caps[1];
if (maxsplit > 0 && --maxsplit == 0) { if (maxsplit > 0 && --maxsplit == 0) {

View File

@ -126,7 +126,7 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t flag_in) {
// Currently supports only blocking mode // Currently supports only blocking mode
(void)self_in; (void)self_in;
if (!mp_obj_is_true(flag_in)) { if (!mp_obj_is_true(flag_in)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
return mp_const_none; return mp_const_none;
} }

View File

@ -219,7 +219,7 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t flag_in) {
// Currently supports only blocking mode // Currently supports only blocking mode
(void)self_in; (void)self_in;
if (!mp_obj_is_true(flag_in)) { if (!mp_obj_is_true(flag_in)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
return mp_const_none; return mp_const_none;
} }

View File

@ -142,6 +142,6 @@ NORETURN void mp_arg_error_terse_mismatch(void) {
#if MICROPY_CPYTHON_COMPAT #if MICROPY_CPYTHON_COMPAT
NORETURN void mp_arg_error_unimpl_kw(void) { NORETURN void mp_arg_error_unimpl_kw(void) {
mp_raise_NotImplementError("keyword argument(s) not yet implemented - use normal args instead"); mp_raise_NotImplementedError("keyword argument(s) not yet implemented - use normal args instead");
} }
#endif #endif

View File

@ -463,7 +463,7 @@ STATIC void mp_lexer_next_token_into(mp_lexer_t *lex, bool first_token) {
// 3MB of text; even gzip-compressed and with minimal structure, it'll take // 3MB of text; even gzip-compressed and with minimal structure, it'll take
// roughly half a meg of storage. This form of Unicode escape may be added // roughly half a meg of storage. This form of Unicode escape may be added
// later on, but it's definitely not a priority right now. -- CJA 20140607 // later on, but it's definitely not a priority right now. -- CJA 20140607
mp_raise_NotImplementError("unicode name escapes"); mp_raise_NotImplementedError("unicode name escapes");
break; break;
default: default:
if (c >= '0' && c <= '7') { if (c >= '0' && c <= '7') {

View File

@ -292,7 +292,7 @@ STATIC mp_obj_t array_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in)
// Otherwise, can only look for a scalar numeric value in an array // Otherwise, can only look for a scalar numeric value in an array
if (MP_OBJ_IS_INT(rhs_in) || mp_obj_is_float(rhs_in)) { if (MP_OBJ_IS_INT(rhs_in) || mp_obj_is_float(rhs_in)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
return mp_const_false; return mp_const_false;
@ -382,7 +382,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)) { } else if (MP_OBJ_IS_TYPE(index_in, &mp_type_slice)) {
mp_bound_slice_t slice; mp_bound_slice_t slice;
if (!mp_seq_get_fast_slice_indexes(o->len, index_in, &slice)) { if (!mp_seq_get_fast_slice_indexes(o->len, index_in, &slice)) {
mp_raise_NotImplementError("only slices with step=1 (aka None) are supported"); mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported");
} }
if (value != MP_OBJ_SENTINEL) { if (value != MP_OBJ_SENTINEL) {
#if MICROPY_PY_ARRAY_SLICE_ASSIGN #if MICROPY_PY_ARRAY_SLICE_ASSIGN
@ -413,7 +413,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value
src_len = bufinfo.len; src_len = bufinfo.len;
src_items = bufinfo.buf; src_items = bufinfo.buf;
} else { } else {
mp_raise_NotImplementError("array/bytes required on right side"); mp_raise_NotImplementedError("array/bytes required on right side");
} }
// TODO: check src/dst compat // TODO: check src/dst compat

View File

@ -380,7 +380,7 @@ STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) {
(void)n_args; (void)n_args;
if (args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little)) { if (args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
// get the buffer info // get the buffer info
@ -405,7 +405,7 @@ STATIC mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *args) {
(void)n_args; (void)n_args;
if (args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little)) { if (args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
mp_uint_t len = MP_OBJ_SMALL_INT_VALUE(args[1]); mp_uint_t len = MP_OBJ_SMALL_INT_VALUE(args[1]);

View File

@ -156,7 +156,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_obj_list_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_list_t *self = MP_OBJ_TO_PTR(self_in);
mp_bound_slice_t slice; mp_bound_slice_t slice;
if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
mp_int_t len_adj = slice.start - slice.stop; mp_int_t len_adj = slice.start - slice.stop;
@ -196,7 +196,7 @@ STATIC mp_obj_t list_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_obj_list_t *slice = MP_OBJ_TO_PTR(value); mp_obj_list_t *slice = MP_OBJ_TO_PTR(value);
mp_bound_slice_t slice_out; mp_bound_slice_t slice_out;
if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice_out)) { if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice_out)) {
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
mp_int_t len_adj = slice->len - (slice_out.stop - slice_out.start); mp_int_t len_adj = slice->len - (slice_out.stop - slice_out.start);
//printf("Len adj: %d\n", len_adj); //printf("Len adj: %d\n", len_adj);

View File

@ -400,7 +400,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)) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
mp_bound_slice_t slice; mp_bound_slice_t slice;
if (!mp_seq_get_fast_slice_indexes(self_len, index, &slice)) { if (!mp_seq_get_fast_slice_indexes(self_len, index, &slice)) {
mp_raise_NotImplementError("only slices with step=1 (aka None) are supported"); mp_raise_NotImplementedError("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); return mp_obj_new_str_of_type(type, self_data + slice.start, slice.stop - slice.start);
} }
@ -609,7 +609,7 @@ STATIC mp_obj_t str_rsplit(size_t n_args, const mp_obj_t *args) {
mp_int_t idx = splits; mp_int_t idx = splits;
if (sep == mp_const_none) { if (sep == mp_const_none) {
mp_raise_NotImplementError("rsplit(None,n)"); mp_raise_NotImplementedError("rsplit(None,n)");
} else { } else {
mp_uint_t sep_len; mp_uint_t sep_len;
const char *sep_str = mp_obj_str_get_data(sep, &sep_len); const char *sep_str = mp_obj_str_get_data(sep, &sep_len);
@ -727,7 +727,7 @@ STATIC mp_obj_t str_endswith(size_t n_args, const mp_obj_t *args) {
GET_STR_DATA_LEN(args[0], str, str_len); GET_STR_DATA_LEN(args[0], str, str_len);
GET_STR_DATA_LEN(args[1], suffix, suffix_len); GET_STR_DATA_LEN(args[1], suffix, suffix_len);
if (n_args > 2) { if (n_args > 2) {
mp_raise_NotImplementError("start/end indices"); mp_raise_NotImplementedError("start/end indices");
} }
if (suffix_len > str_len) { if (suffix_len > str_len) {
@ -1023,7 +1023,7 @@ STATIC vstr_t mp_obj_str_format_helper(const char *str, const char *top, int *ar
arg = key_elem->value; arg = key_elem->value;
} }
if (field_name < field_name_top) { if (field_name < field_name_top) {
mp_raise_NotImplementError("attributes not supported yet"); mp_raise_NotImplementedError("attributes not supported yet");
} }
} else { } else {
if (*arg_i < 0) { if (*arg_i < 0) {

View File

@ -188,7 +188,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_t ostart, ostop, ostep;
mp_obj_slice_get(index, &ostart, &ostop, &ostep); mp_obj_slice_get(index, &ostart, &ostop, &ostep);
if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) { if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) {
mp_raise_NotImplementError("only slices with step=1 (aka None) are supported"); mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported");
} }
const byte *pstart, *pstop; const byte *pstart, *pstop;

View File

@ -181,7 +181,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)) { if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
mp_bound_slice_t slice; mp_bound_slice_t slice;
if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) { if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) {
mp_raise_NotImplementError("only slices with step=1 (aka None) are supported"); mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported");
} }
mp_obj_tuple_t *res = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice.stop - slice.start, NULL)); mp_obj_tuple_t *res = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice.stop - slice.start, NULL));
mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t); mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t);

View File

@ -1479,7 +1479,7 @@ NORETURN void mp_raise_RuntimeError(const char *msg) {
mp_raise_msg(&mp_type_RuntimeError, msg); mp_raise_msg(&mp_type_RuntimeError, msg);
} }
NORETURN void mp_raise_NotImplementError(const char *msg) { NORETURN void mp_raise_NotImplementedError(const char *msg) {
mp_raise_msg(&mp_type_NotImplementedError, msg); mp_raise_msg(&mp_type_NotImplementedError, msg);
} }

View File

@ -142,7 +142,7 @@ NORETURN void mp_raise_TypeError(const char *msg);
NORETURN void mp_raise_TypeError_varg(const char *fmt, ...); NORETURN void mp_raise_TypeError_varg(const char *fmt, ...);
NORETURN void mp_raise_AttributeError(const char *msg); NORETURN void mp_raise_AttributeError(const char *msg);
NORETURN void mp_raise_RuntimeError(const char *msg); NORETURN void mp_raise_RuntimeError(const char *msg);
NORETURN void mp_raise_NotImplementError(const char *msg); NORETURN void mp_raise_NotImplementedError(const char *msg);
NORETURN void mp_raise_ImportError(const char *msg); NORETURN void mp_raise_ImportError(const char *msg);
NORETURN void mp_raise_IndexError(const char *msg); NORETURN void mp_raise_IndexError(const char *msg);
NORETURN void mp_raise_OSError(int errno_); NORETURN void mp_raise_OSError(int errno_);

View File

@ -268,7 +268,7 @@ STATIC mp_obj_t jobject_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
return mp_const_none; return mp_const_none;
} }
} }
mp_raise_NotImplementError(""); mp_raise_NotImplementedError("");
} }
if (!JJ(IsInstanceOf, self->obj, List_class)) { if (!JJ(IsInstanceOf, self->obj, List_class)) {