mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
762ec97ea6
commit
d4edfc9abf
8 changed files with 31 additions and 19 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue