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:
Georg Brandl 2007-03-05 22:28:13 +00:00
parent 131069b3a0
commit 0ea891603d
3 changed files with 18 additions and 1 deletions

View file

@ -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;