summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-17 17:03:16 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-17 17:03:16 +1100
commit5bea080737ee4a22e2a99aa03743cdf4b6396b7d (patch)
tree4445c4df5d98b17b14af9c92161b50b76fa4f080
parentf51f22dd42b16c48b18d36d874ceaaa0840ae10b (diff)
downloadmicropython-5bea080737ee4a22e2a99aa03743cdf4b6396b7d.tar.gz
micropython-5bea080737ee4a22e2a99aa03743cdf4b6396b7d.zip
py/objexcept: Replace if-cond and assert(0) with simple assert.
-rw-r--r--py/objexcept.c6
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);