Merge pull request #3902 from kimnanhee/main

Fix byte indices must be integers or slices, error message
This commit is contained in:
Jeong YunWon
2022-07-16 16:17:07 +09:00
committed by GitHub
2 changed files with 1 additions and 3 deletions

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"

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