mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix byte indices must be integers or slices, error message
This commit is contained in:
1 parent
d3e8e47c9e
commit
4b659f92aa
2 files changed
+1
-3
No files matched your search
Vendored
-2
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user