Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e9739e33
Commit
e9739e33
authored
Jun 18, 2016
by
Paul Sokolovsky
Browse files
extmod/modbtree: __getitem__() should raise KeyError for non-existing key.
parent
cbffd0aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
extmod/modbtree.c
View file @
e9739e33
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment