mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Merge pull request #3902 from kimnanhee/main
Fix byte indices must be integers or slices, error message
This commit is contained in:
2
Lib/test/test_bytes.py
vendored
2
Lib/test/test_bytes.py
vendored
@@ -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