mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user