diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-10 13:55:11 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-10 13:55:11 +0100 |
commit | d0a5bf34f746276550aef9c8519160c033611571 (patch) | |
tree | 2c24601b11eeb11f161082a92b89eb559702cc4e /py/objdict.c | |
parent | 2bb179e1248f045525b247981e3e5285800b63d6 (diff) | |
download | micropython-d0a5bf34f746276550aef9c8519160c033611571.tar.gz micropython-d0a5bf34f746276550aef9c8519160c033611571.zip |
py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.
Diffstat (limited to 'py/objdict.c')
-rw-r--r-- | py/objdict.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/py/objdict.c b/py/objdict.c index 6a6fff2a9f..9d4ebb6279 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -465,12 +465,15 @@ STATIC void dict_view_print(void (*print)(void *env, const char *fmt, ...), void STATIC mp_obj_t dict_view_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) { /* only supported for the 'keys' kind until sets and dicts are refactored */ mp_obj_dict_view_t *o = lhs_in; - if (o->kind != MP_DICT_VIEW_KEYS) return NULL; - if (op != MP_BINARY_OP_IN) return NULL; + if (o->kind != MP_DICT_VIEW_KEYS) { + return MP_OBJ_NOT_SUPPORTED; + } + if (op != MP_BINARY_OP_IN) { + return MP_OBJ_NOT_SUPPORTED; + } return dict_binary_op(op, o->dict, rhs_in); } - STATIC const mp_obj_type_t dict_view_type = { { &mp_type_type }, .name = MP_QSTR_dict_view, |