Fix byte indices must be integers or slices, error message

This commit is contained in:
kimnanhee committed 2022-07-16 15:38:21 +09:00
1 parent d3e8e47c9e
commit 4b659f92aa
2 files changed
+1 -3

No files matched your search

-2
View File
@@ -989,8 +989,6 @@ class BaseBytesTest:
class BytesTest(BaseBytesTest, unittest.TestCase):
type2test = bytes
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_getitem_error(self):
b = b'python'
msg = "byte indices must be integers or slices"
+1 -1
View File
@@ -167,7 +167,7 @@ impl PyBytes {
}
fn _getitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult {
match SequenceIndex::try_from_borrowed_object(vm, needle, "bytes")? {
match SequenceIndex::try_from_borrowed_object(vm, needle, "byte")? {
SequenceIndex::Int(i) => self
.inner
.elements