Skip to content

Commit 2e77581

Browse files
authored
Merge pull request #3902 from kimnanhee/main
Fix byte indices must be integers or slices, error message
2 parents ceb7d68 + 4b659f9 commit 2e77581

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Lib/test/test_bytes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,6 @@ def test_sq_item(self):
989989
class BytesTest(BaseBytesTest, unittest.TestCase):
990990
type2test = bytes
991991

992-
# TODO: RUSTPYTHON
993-
@unittest.expectedFailure
994992
def test_getitem_error(self):
995993
b = b'python'
996994
msg = "byte indices must be integers or slices"

vm/src/builtins/bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl PyBytes {
167167
}
168168

169169
fn _getitem(&self, needle: &PyObject, vm: &VirtualMachine) -> PyResult {
170-
match SequenceIndex::try_from_borrowed_object(vm, needle, "bytes")? {
170+
match SequenceIndex::try_from_borrowed_object(vm, needle, "byte")? {
171171
SequenceIndex::Int(i) => self
172172
.inner
173173
.elements

0 commit comments

Comments
 (0)