Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
22602cc3
Commit
22602cc3
authored
Sep 01, 2015
by
Damien George
Browse files
py/objstr: Make str.rsplit(None,n) raise NotImpl instead of assert(0).
parent
1b693543
Changes
3
Hide whitespace changes
Inline
Side-by-side
py/objstr.c
View file @
22602cc3
...
...
@@ -578,7 +578,7 @@ STATIC mp_obj_t str_rsplit(mp_uint_t n_args, const mp_obj_t *args) {
mp_int_t
idx
=
splits
;
if
(
sep
==
mp_const_none
)
{
assert
(
!
"TODO: rsplit(None,n) not implemented
"
);
mp_not_implemented
(
"rsplit(None,n)
"
);
}
else
{
mp_uint_t
sep_len
;
const
char
*
sep_str
=
mp_obj_str_get_data
(
sep
,
&
sep_len
);
...
...
tests/misc/non_compliant.py
View file @
22602cc3
...
...
@@ -39,3 +39,9 @@ try:
print
(
'{a[0]}'
.
format
(
a
=
[
1
,
2
]))
except
NotImplementedError
:
print
(
'NotImplementedError'
)
# str.rsplit(None, n) not implemented
try
:
'a a a'
.
rsplit
(
None
,
1
)
except
NotImplementedError
:
print
(
'NotImplementedError'
)
tests/misc/non_compliant.py.exp
View file @
22602cc3
...
...
@@ -4,3 +4,4 @@ True
True
TypeError, ValueError
NotImplementedError
NotImplementedError
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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