mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
py/objexcept: Replace if-cond and assert(0) with simple assert.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user