mirror of
https://github.com/python/cpython.git
synced 2025-08-19 16:20:59 +00:00
Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot. (backport from rev. 54139)
This commit is contained in:
parent
131069b3a0
commit
0ea891603d
3 changed files with 18 additions and 1 deletions
|
@ -3926,7 +3926,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