py/objexcept: Replace if-cond and assert(0) with simple assert.

This commit is contained in:
Damien George 2017-01-17 17:03:16 +11:00
parent f51f22dd42
commit 5bea080737
1 changed files with 2 additions and 4 deletions

View File

@ -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);