From 6523abcac19ec4ece863d7fe5e67efd697e78997 Mon Sep 17 00:00:00 2001 From: clemado1 Date: Wed, 12 Aug 2020 23:21:03 +0900 Subject: [PATCH] Fix error message in objsequence.get_item --- Lib/test/list_tests.py | 2 -- Lib/test/test_tuple.py | 2 -- vm/src/obj/objsequence.rs | 4 ++-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index 249249f60..a45cac649 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -33,8 +33,6 @@ class CommonTest(seq_tests.CommonTest): self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_getitem_error(self): a = [] msg = "list indices must be integers or slices" diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index 5d7b9980a..c4a0d5f1b 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -18,8 +18,6 @@ JUST_SHOW_HASH_RESULTS = False # if RUN_ALL_HASH_TESTS, just display class TupleTest(seq_tests.CommonTest): type2test = tuple - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_getitem_error(self): t = () msg = "tuple indices must be integers or slices" diff --git a/vm/src/obj/objsequence.rs b/vm/src/obj/objsequence.rs index ebb07c336..1016cb32a 100644 --- a/vm/src/obj/objsequence.rs +++ b/vm/src/obj/objsequence.rs @@ -252,8 +252,8 @@ pub fn get_item( } } else { Err(vm.new_type_error(format!( - "indexing type {:?} with index {:?} is not supported (yet?)", - sequence, subscript + "{} indices must be integers or slices", + sequence.lease_class().name ))) } }