py: Shorten a couple of error messages.
This commit is contained in:
parent
f55a059e7a
commit
18c059febf
|
@ -1524,7 +1524,7 @@ STATIC void compile_try_except(compiler_t *comp, mp_parse_node_t pn_body, int n_
|
||||||
if (MP_PARSE_NODE_IS_NULL(pns_except->nodes[0])) {
|
if (MP_PARSE_NODE_IS_NULL(pns_except->nodes[0])) {
|
||||||
// this is a catch all exception handler
|
// this is a catch all exception handler
|
||||||
if (i + 1 != n_except) {
|
if (i + 1 != n_except) {
|
||||||
compile_syntax_error(comp, pn_excepts[i], "default 'except:' must be last");
|
compile_syntax_error(comp, pn_excepts[i], "default 'except' must be last");
|
||||||
compile_decrease_except_level(comp);
|
compile_decrease_except_level(comp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,7 +386,7 @@ STATIC mp_obj_t dict_update(size_t n_args, const mp_obj_t *args, mp_map_t *kwarg
|
||||||
if (key == MP_OBJ_STOP_ITERATION
|
if (key == MP_OBJ_STOP_ITERATION
|
||||||
|| value == MP_OBJ_STOP_ITERATION
|
|| value == MP_OBJ_STOP_ITERATION
|
||||||
|| stop != MP_OBJ_STOP_ITERATION) {
|
|| stop != MP_OBJ_STOP_ITERATION) {
|
||||||
mp_raise_ValueError("dictionary update sequence has the wrong length");
|
mp_raise_ValueError("dict update sequence has wrong length");
|
||||||
} else {
|
} else {
|
||||||
mp_map_lookup(&self->map, key, MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = value;
|
mp_map_lookup(&self->map, key, MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue