diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-08-11 22:36:38 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-08-11 22:38:00 +0300 |
commit | 9749b2fb0d6c4ff65c7395e09028102c9508b34a (patch) | |
tree | b6aaa1bb52bd1ed7516ae4545771f0b797ae8057 /tests | |
parent | 6e6bcccdc19f35ccb09c064cb444eb498c307a33 (diff) | |
download | micropython-9749b2fb0d6c4ff65c7395e09028102c9508b34a.tar.gz micropython-9749b2fb0d6c4ff65c7395e09028102c9508b34a.zip |
objstr: Make sure that bytes are indexed as bytes, not as unicode.
Fixes #795.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/bytes.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/bytes.py b/tests/basics/bytes.py index a084bc3994..ce027e7d19 100644 --- a/tests/basics/bytes.py +++ b/tests/basics/bytes.py @@ -37,3 +37,8 @@ def gen(): for i in range(4): yield i print(bytes(gen())) + +# Make sure bytes are not mistreated as unicode +x = b"\xff\x8e\xfe}\xfd\x7f" +print(len(x)) +print(x[0], x[1], x[2], x[3]) |