mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
objstr: Make .[r]partition() work with bytes.
This commit is contained in:
@@ -27,3 +27,14 @@ except ValueError:
|
||||
print("Raised ValueError")
|
||||
else:
|
||||
print("Did not raise ValueError")
|
||||
|
||||
# Bytes
|
||||
print(b"abba".partition(b'b'))
|
||||
try:
|
||||
print(b"abba".partition('b'))
|
||||
except TypeError:
|
||||
print("Raised TypeError")
|
||||
try:
|
||||
print("abba".partition(b'b'))
|
||||
except TypeError:
|
||||
print("Raised TypeError")
|
||||
|
||||
Reference in New Issue
Block a user