diff options
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 3698250..2d4f2e1 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1623,7 +1623,7 @@ PySequence_GetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2) if (!s) return null_error(); mp = s->ob_type->tp_as_mapping; - if (mp->mp_subscript) { + if (mp && mp->mp_subscript) { PyObject *res; PyObject *slice = _PySlice_FromIndices(i1, i2); if (!slice) @@ -1701,7 +1701,7 @@ PySequence_SetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2, PyObject *o) } mp = s->ob_type->tp_as_mapping; - if (mp->mp_ass_subscript) { + if (mp && mp->mp_ass_subscript) { int res; PyObject *slice = _PySlice_FromIndices(i1, i2); if (!slice) @@ -1726,7 +1726,7 @@ PySequence_DelSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2) } mp = s->ob_type->tp_as_mapping; - if (mp->mp_ass_subscript) { + if (mp && mp->mp_ass_subscript) { int res; PyObject *slice = _PySlice_FromIndices(i1, i2); if (!slice) |