mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #16402: Merge fix from 3.2
This commit is contained in:
commit
1321edaa55
3 changed files with 17 additions and 5 deletions
|
@ -331,11 +331,11 @@ compute_slice_element(PyObject *obj)
|
|||
if (PyIndex_Check(obj)) {
|
||||
result = PyNumber_Index(obj);
|
||||
}
|
||||
}
|
||||
if (result == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"slice indices must be integers or "
|
||||
"None or have an __index__ method");
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"slice indices must be integers or "
|
||||
"None or have an __index__ method");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue