diff options
Diffstat (limited to 'py/objbool.c')
-rw-r--r-- | py/objbool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/py/objbool.c b/py/objbool.c index 5f17fd6133..6afb6e950d 100644 --- a/py/objbool.c +++ b/py/objbool.c @@ -26,7 +26,7 @@ STATIC mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp switch (n_args) { case 0: return mp_const_false; - case 1: if (rt_is_true(args[0])) { return mp_const_true; } else { return mp_const_false; } + case 1: if (mp_obj_is_true(args[0])) { return mp_const_true; } else { return mp_const_false; } default: nlr_jump(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "bool takes at most 1 argument, %d given", n_args)); } } @@ -34,10 +34,10 @@ STATIC mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp STATIC mp_obj_t bool_unary_op(int op, mp_obj_t o_in) { machine_int_t value = ((mp_obj_bool_t*)o_in)->value; switch (op) { - case RT_UNARY_OP_BOOL: return o_in; - case RT_UNARY_OP_POSITIVE: return MP_OBJ_NEW_SMALL_INT(value); - case RT_UNARY_OP_NEGATIVE: return MP_OBJ_NEW_SMALL_INT(-value); - case RT_UNARY_OP_INVERT: + case MP_UNARY_OP_BOOL: return o_in; + case MP_UNARY_OP_POSITIVE: return MP_OBJ_NEW_SMALL_INT(value); + case MP_UNARY_OP_NEGATIVE: return MP_OBJ_NEW_SMALL_INT(-value); + case MP_UNARY_OP_INVERT: default: // no other cases return MP_OBJ_NEW_SMALL_INT(~value); } |