summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--extmod/modbtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modbtree.c b/extmod/modbtree.c
index eff2cd1f5a..345b4d1618 100644
--- a/extmod/modbtree.c
+++ b/extmod/modbtree.c
@@ -203,7 +203,7 @@ STATIC mp_obj_t btree_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
key.data = (void*)mp_obj_str_get_data(index, &key.size);
int res = __bt_get(self->db, &key, &val, 0);
if (res == RET_SPECIAL) {
- return mp_const_none;
+ nlr_raise(mp_obj_new_exception(&mp_type_KeyError));
}
CHECK_ERROR(res);
return mp_obj_new_bytes(val.data, val.size);