mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
This commit is contained in:
parent
ca90ca81a4
commit
0fca97a5fb
3 changed files with 18 additions and 1 deletions
|
@ -3927,7 +3927,7 @@ assign_slice(PyObject *u, PyObject *v, PyObject *w, PyObject *x)
|
|||
PyTypeObject *tp = u->ob_type;
|
||||
PySequenceMethods *sq = tp->tp_as_sequence;
|
||||
|
||||
if (sq && sq->sq_slice && ISINDEX(v) && ISINDEX(w)) {
|
||||
if (sq && sq->sq_ass_slice && ISINDEX(v) && ISINDEX(w)) {
|
||||
Py_ssize_t ilow = 0, ihigh = PY_SSIZE_T_MAX;
|
||||
if (!_PyEval_SliceIndex(v, &ilow))
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue