Skip to content
Snippets Groups Projects
Commit 5bea0807 authored by Damien George's avatar Damien George
Browse files

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

parent f51f22dd
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment