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

View file

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