diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-17 17:03:16 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-17 17:03:16 +1100 |
commit | 5bea080737ee4a22e2a99aa03743cdf4b6396b7d (patch) | |
tree | 4445c4df5d98b17b14af9c92161b50b76fa4f080 | |
parent | f51f22dd42b16c48b18d36d874ceaaa0840ae10b (diff) | |
download | micropython-5bea080737ee4a22e2a99aa03743cdf4b6396b7d.tar.gz micropython-5bea080737ee4a22e2a99aa03743cdf4b6396b7d.zip |
py/objexcept: Replace if-cond and assert(0) with simple assert.
-rw-r--r-- | py/objexcept.c | 6 |
1 files 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); |