Skip to content

Commit 5bea080

Browse files
committed
py/objexcept: Replace if-cond and assert(0) with simple assert.
1 parent f51f22d commit 5bea080

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

py/objexcept.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,8 @@ mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char
383383
o->traceback_data = NULL;
384384
o->args = MP_OBJ_TO_PTR(mp_obj_new_tuple(1, NULL));
385385

386-
if (fmt == NULL) {
387-
// no message
388-
assert(0);
389-
} else {
386+
assert(fmt != NULL);
387+
{
390388
if (strchr(fmt, '%') == NULL) {
391389
// no formatting substitutions, avoid allocating vstr.
392390
o->args->items[0] = mp_obj_new_str(fmt, strlen(fmt), false);

0 commit comments

Comments
 (0)