diff options
author | Damien George <damien.p.george@gmail.com> | 2015-09-04 16:49:56 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-09-04 16:49:56 +0100 |
commit | 55b11e6d38731ffb1a7378f936c940c61aef8743 (patch) | |
tree | a59475569251552b4087049f8fa87cfafd0c1edc /py/objstr.c | |
parent | 0b7a66ab9795948dfdffa65a4e542f86bc00f597 (diff) | |
download | micropython-55b11e6d38731ffb1a7378f936c940c61aef8743.tar.gz micropython-55b11e6d38731ffb1a7378f936c940c61aef8743.zip |
py/objstr: For str.endswith(s, start) raise NotImpl instead of assert.
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c index 274e76daaa..704fa07e1d 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -699,7 +699,9 @@ STATIC mp_obj_t str_startswith(mp_uint_t n_args, const mp_obj_t *args) { STATIC mp_obj_t str_endswith(mp_uint_t n_args, const mp_obj_t *args) { GET_STR_DATA_LEN(args[0], str, str_len); GET_STR_DATA_LEN(args[1], suffix, suffix_len); - assert(n_args == 2); + if (n_args > 2) { + mp_not_implemented("start/end indices"); + } if (suffix_len > str_len) { return mp_const_false; |