Skip to content

Commit

Permalink
Merge 1bb725e into ed7ddd4
Browse files Browse the repository at this point in the history
  • Loading branch information
Arrowana committed Oct 31, 2020
2 parents ed7ddd4 + 1bb725e commit f13c883
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extmod/machine_mem.c
Expand Up @@ -63,6 +63,9 @@ STATIC void machine_mem_print(const mp_print_t *print, mp_obj_t self_in, mp_prin
STATIC mp_obj_t machine_mem_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
// TODO support slice index to read/write multiple values at once
machine_mem_obj_t *self = MP_OBJ_TO_PTR(self_in);
if (mp_obj_is_type(index, &mp_type_slice)) {
mp_raise_NotImplementedError(MP_ERROR_TEXT("Does not support slices"));
}
if (value == MP_OBJ_NULL) {
// delete
return MP_OBJ_NULL; // op not supported
Expand Down
5 changes: 5 additions & 0 deletions tests/extmod/machine1.py
Expand Up @@ -26,3 +26,8 @@
del machine.mem8[0]
except TypeError:
print("TypeError")

try:
machine.mem8[0:1]
except NotImplementedError:
print("NotImplementedError")
1 change: 1 addition & 0 deletions tests/extmod/machine1.py.exp
Expand Up @@ -2,3 +2,4 @@
ValueError
ValueError
TypeError
NotImplementedError

0 comments on commit f13c883

Please sign in to comment.