aboutsummaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
authorDamien George2020-04-09 17:22:25 +1000
committerDamien George2020-04-13 22:19:37 +1000
commit8e048d2548867aac743866ca5a4c244b7b5aac09 (patch)
treee62e2ce312ba0e6dc498d7db8901d935f6afd3de /extmod
parentdb137e70dcf67de26828e17c2d3dc9d21e971eb0 (diff)
all: Clean up error strings to use lowercase and change cannot to can't.
Now that error string compression is supported it's more important to have consistent error string formatting (eg all lowercase English words, consistent contractions). This commit cleans up some of the strings to make them more consistent.
Diffstat (limited to 'extmod')
-rw-r--r--extmod/moduasyncio.c2
-rw-r--r--extmod/moductypes.c4
-rw-r--r--extmod/modure.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c
index 01ec58294..0b15c9e07 100644
--- a/extmod/moduasyncio.c
+++ b/extmod/moduasyncio.c
@@ -173,7 +173,7 @@ STATIC mp_obj_t task_cancel(mp_obj_t self_in) {
// Can't cancel self (not supported yet).
mp_obj_t cur_task = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
if (self_in == cur_task) {
- mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("cannot cancel self"));
+ mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("can't cancel self"));
}
// If Task waits on another task then forward the cancel to the one it's waiting on.
while (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type(self->data)), MP_OBJ_FROM_PTR(&task_type))) {
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
index 59da5f91e..a7a905c66 100644
--- a/extmod/moductypes.c
+++ b/extmod/moductypes.c
@@ -226,7 +226,7 @@ STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, int layout_type, mp_uint_
// but scalar structure field is lowered into native Python int, so all
// type info is lost. So, we cannot say if it's scalar type description,
// or such lowered scalar.
- mp_raise_TypeError(MP_ERROR_TEXT("Cannot unambiguously get sizeof scalar"));
+ mp_raise_TypeError(MP_ERROR_TEXT("can't unambiguously get sizeof scalar"));
}
syntax_error();
}
@@ -557,7 +557,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_ob
} else {
// load / store
if (!mp_obj_is_type(self->desc, &mp_type_tuple)) {
- mp_raise_TypeError(MP_ERROR_TEXT("struct: cannot index"));
+ mp_raise_TypeError(MP_ERROR_TEXT("struct: can't index"));
}
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->desc);
diff --git a/extmod/modure.c b/extmod/modure.c
index ed16955ae..ff99e66d8 100644
--- a/extmod/modure.c
+++ b/extmod/modure.c
@@ -235,7 +235,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) {
mp_obj_t s = mp_obj_new_str_of_type(str_type, (const byte *)subj.begin, caps[0] - subj.begin);
mp_obj_list_append(retval, s);
if (self->re.sub > 0) {
- mp_raise_NotImplementedError(MP_ERROR_TEXT("Splitting with sub-captures"));
+ mp_raise_NotImplementedError(MP_ERROR_TEXT("splitting with sub-captures"));
}
subj.begin = caps[1];
if (maxsplit > 0 && --maxsplit == 0) {
@@ -403,7 +403,7 @@ STATIC mp_obj_t mod_re_compile(size_t n_args, const mp_obj_t *args) {
int error = re1_5_compilecode(&o->re, re_str);
if (error != 0) {
error:
- mp_raise_ValueError(MP_ERROR_TEXT("Error in regex"));
+ mp_raise_ValueError(MP_ERROR_TEXT("error in regex"));
}
#if MICROPY_PY_URE_DEBUG
if (flags & FLAG_DEBUG) {