py/objexcept: Replace if-cond and assert(0) with simple assert.
This commit is contained in:
parent
f51f22dd42
commit
5bea080737
|
@ -383,10 +383,8 @@ mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char
|
||||||
o->traceback_data = NULL;
|
o->traceback_data = NULL;
|
||||||
o->args = MP_OBJ_TO_PTR(mp_obj_new_tuple(1, NULL));
|
o->args = MP_OBJ_TO_PTR(mp_obj_new_tuple(1, NULL));
|
||||||
|
|
||||||
if (fmt == NULL) {
|
assert(fmt != NULL);
|
||||||
// no message
|
{
|
||||||
assert(0);
|
|
||||||
} else {
|
|
||||||
if (strchr(fmt, '%') == NULL) {
|
if (strchr(fmt, '%') == NULL) {
|
||||||
// no formatting substitutions, avoid allocating vstr.
|
// no formatting substitutions, avoid allocating vstr.
|
||||||
o->args->items[0] = mp_obj_new_str(fmt, strlen(fmt), false);
|
o->args->items[0] = mp_obj_new_str(fmt, strlen(fmt), false);
|
||||||
|
|
Loading…
Reference in New Issue