From 5bea080737ee4a22e2a99aa03743cdf4b6396b7d Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 17 Jan 2017 17:03:16 +1100 Subject: [PATCH] py/objexcept: Replace if-cond and assert(0) with simple assert. --- py/objexcept.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/py/objexcept.c b/py/objexcept.c index c1b992d276..76d34f56e4 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -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->args = MP_OBJ_TO_PTR(mp_obj_new_tuple(1, NULL)); - if (fmt == NULL) { - // no message - assert(0); - } else { + assert(fmt != NULL); + { if (strchr(fmt, '%') == NULL) { // no formatting substitutions, avoid allocating vstr. o->args->items[0] = mp_obj_new_str(fmt, strlen(fmt), false);