summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 9c4fe7c72..4e055776b 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -188,7 +188,7 @@ mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) {
mp_int_t val = MP_OBJ_SMALL_INT_VALUE(arg);
switch (op) {
case MP_UNARY_OP_BOOL:
- return MP_BOOL(val != 0);
+ return mp_obj_new_bool(val != 0);
case MP_UNARY_OP_HASH:
return arg;
case MP_UNARY_OP_POSITIVE:
@@ -243,7 +243,7 @@ mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
// deal with is
if (op == MP_BINARY_OP_IS) {
- return MP_BOOL(lhs == rhs);
+ return mp_obj_new_bool(lhs == rhs);
}
// deal with == and != for all types
@@ -443,10 +443,10 @@ mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs) {
return tuple;
}
- case MP_BINARY_OP_LESS: return MP_BOOL(lhs_val < rhs_val); break;
- case MP_BINARY_OP_MORE: return MP_BOOL(lhs_val > rhs_val); break;
- case MP_BINARY_OP_LESS_EQUAL: return MP_BOOL(lhs_val <= rhs_val); break;
- case MP_BINARY_OP_MORE_EQUAL: return MP_BOOL(lhs_val >= rhs_val); break;
+ case MP_BINARY_OP_LESS: return mp_obj_new_bool(lhs_val < rhs_val); break;
+ case MP_BINARY_OP_MORE: return mp_obj_new_bool(lhs_val > rhs_val); break;
+ case MP_BINARY_OP_LESS_EQUAL: return mp_obj_new_bool(lhs_val <= rhs_val); break;
+ case MP_BINARY_OP_MORE_EQUAL: return mp_obj_new_bool(lhs_val >= rhs_val); break;
default:
goto unsupported_op;