bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887)

when pass indices of wrong type.
This commit is contained in:
Serhiy Storchaka 2017-03-30 18:29:23 +03:00 committed by GitHub
parent 762ec97ea6
commit d4edfc9abf
8 changed files with 31 additions and 19 deletions

View file

@ -2670,9 +2670,9 @@ class slice_index_converter(CConverter):
def converter_init(self, *, accept={int, NoneType}):
if accept == {int}:
self.converter = '_PyEval_SliceIndex'
self.converter = '_PyEval_SliceIndexNotNone'
elif accept == {int, NoneType}:
self.converter = '_PyEval_SliceIndexOrNone'
self.converter = '_PyEval_SliceIndex'
else:
fail("slice_index_converter: illegal 'accept' argument " + repr(accept))