summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-09 17:22:25 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-13 22:19:37 +1000
commit8e048d2548867aac743866ca5a4c244b7b5aac09 (patch)
treee62e2ce312ba0e6dc498d7db8901d935f6afd3de /py
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 'py')
-rw-r--r--py/builtinimport.c2
-rw-r--r--py/objslice.c2
-rw-r--r--py/objtype.c4
-rw-r--r--py/runtime.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c
index 5c82c68d9..28a8f41f7 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -313,7 +313,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
// We must have some component left over to import from
if (p == this_name) {
- mp_raise_ValueError(MP_ERROR_TEXT("cannot perform relative import"));
+ mp_raise_ValueError(MP_ERROR_TEXT("can't perform relative import"));
}
uint new_mod_l = (mod_len == 0 ? (size_t)(p - this_name) : (size_t)(p - this_name) + 1 + mod_len);
diff --git a/py/objslice.c b/py/objslice.c
index 290c29150..c65c30601 100644
--- a/py/objslice.c
+++ b/py/objslice.c
@@ -124,7 +124,7 @@ void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *r
} else {
step = mp_obj_get_int(self->step);
if (step == 0) {
- mp_raise_ValueError(MP_ERROR_TEXT("slice step cannot be zero"));
+ mp_raise_ValueError(MP_ERROR_TEXT("slice step can't be zero"));
}
}
diff --git a/py/objtype.c b/py/objtype.c
index 3f32cd601..a8eeb1a9f 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -989,9 +989,9 @@ STATIC mp_obj_t type_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp
if (self->make_new == NULL) {
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
- mp_raise_TypeError(MP_ERROR_TEXT("cannot create instance"));
+ mp_raise_TypeError(MP_ERROR_TEXT("can't create instance"));
#else
- mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("cannot create '%q' instances"), self->name);
+ mp_raise_msg_varg(&mp_type_TypeError, MP_ERROR_TEXT("can't create '%q' instances"), self->name);
#endif
}
diff --git a/py/runtime.c b/py/runtime.c
index cad2fc256..1fa9e73f2 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1392,7 +1392,7 @@ mp_obj_t mp_import_from(mp_obj_t module, qstr name) {
if (dest[1] != MP_OBJ_NULL) {
// Hopefully we can't import bound method from an object
import_error:
- mp_raise_msg_varg(&mp_type_ImportError, MP_ERROR_TEXT("cannot import name %q"), name);
+ mp_raise_msg_varg(&mp_type_ImportError, MP_ERROR_TEXT("can't import name %q"), name);
}
if (dest[0] != MP_OBJ_NULL) {