summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-08-14 16:23:21 +1000
committerDamien George <damien.p.george@gmail.com>2018-08-14 16:23:21 +1000
commita785a3dbfb02f5df901e78dfc63cf31502677d82 (patch)
tree730592265262c1fffc1f2725ce6608308d1937f1
parent91041945c91bae96d918876547cae48484cd8953 (diff)
py/objarray: Allow to build again when bytearray is disabled.
-rw-r--r--py/objarray.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/objarray.c b/py/objarray.c
index aa9fa3b73..56038a7d6 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -270,10 +270,10 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
}
case MP_BINARY_OP_CONTAINS: {
+ #if MICROPY_PY_BUILTINS_BYTEARRAY
+ // Can search string only in bytearray
mp_buffer_info_t lhs_bufinfo;
mp_buffer_info_t rhs_bufinfo;
-
- // Can search string only in bytearray
if (mp_get_buffer(rhs_in, &rhs_bufinfo, MP_BUFFER_READ)) {
if (!MP_OBJ_IS_TYPE(lhs_in, &mp_type_bytearray)) {
return mp_const_false;
@@ -282,6 +282,7 @@ STATIC mp_obj_t array_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs
return mp_obj_new_bool(
find_subbytes(lhs_bufinfo.buf, lhs_bufinfo.len, rhs_bufinfo.buf, rhs_bufinfo.len, 1) != NULL);
}
+ #endif
// Otherwise, can only look for a scalar numeric value in an array
if (MP_OBJ_IS_INT(rhs_in) || mp_obj_is_float(rhs_in)) {