py/objstrunicode: str_index_to_ptr: Should handle bytes too.

There's single str_index_to_ptr() function, called for both bytes and
unicode objects, so should handle each properly.
This commit is contained in:
Paul Sokolovsky
2016-07-25 14:43:04 +03:00
parent 16f324641f
commit 6af90b2972
2 changed files with 11 additions and 1 deletions

View File

@@ -21,3 +21,6 @@ print(b"0000".find(b'-1', 3))
print(b"0000".find(b'1', 3))
print(b"0000".find(b'1', 4))
print(b"0000".find(b'1', 5))
# Non-ascii values (make sure not treated as unicode-like)
print(b"\x80abc".find(b"a", 1))