|
1 |
| -index 7d29634b..bb440851 100644 |
| 1 | +diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c |
| 2 | +index c5ea2cb..b797540 100644 |
| 3 | +--- a/src/c/_cffi_backend.c |
| 4 | ++++ b/src/c/_cffi_backend.c |
| 5 | +@@ -2516,19 +2516,22 @@ _cdata_getslicearg(CDataObject *cd, PySliceObject *slice, Py_ssize_t bounds[]) |
| 6 | + Py_ssize_t start, stop; |
| 7 | + CTypeDescrObject *ct; |
| 8 | + |
| 9 | +- start = PyInt_AsSsize_t(slice->start); |
| 10 | ++ PyObject* slicestart = PySlice_Start(slice); |
| 11 | ++ start = PyInt_AsSsize_t(slicestart); |
| 12 | + if (start == -1 && PyErr_Occurred()) { |
| 13 | +- if (slice->start == Py_None) |
| 14 | ++ if (slicestart == Py_None) |
| 15 | + PyErr_SetString(PyExc_IndexError, "slice start must be specified"); |
| 16 | + return NULL; |
| 17 | + } |
| 18 | +- stop = PyInt_AsSsize_t(slice->stop); |
| 19 | ++ PyObject* slicestop = PySlice_Stop(slice); |
| 20 | ++ stop = PyInt_AsSsize_t(slicestop); |
| 21 | + if (stop == -1 && PyErr_Occurred()) { |
| 22 | +- if (slice->stop == Py_None) |
| 23 | ++ if (slicestop == Py_None) |
| 24 | + PyErr_SetString(PyExc_IndexError, "slice stop must be specified"); |
| 25 | + return NULL; |
| 26 | + } |
| 27 | +- if (slice->step != Py_None) { |
| 28 | ++ PyObject* slicestep = PySlice_Step(slice); |
| 29 | ++ if (slicestep != Py_None) { |
| 30 | + PyErr_SetString(PyExc_IndexError, "slice with step not supported"); |
| 31 | + return NULL; |
| 32 | + } |
| 33 | +diff --git a/src/c/misc_thread_common.h b/src/c/misc_thread_common.h |
| 34 | +index ead9c83..a3ca2fe 100644 |
2 | 35 | --- a/src/c/misc_thread_common.h
|
3 | 36 | +++ b/src/c/misc_thread_common.h
|
4 |
| -@@ -344,45 +344,7 @@ static PyThreadState *get_current_ts(void) |
| 37 | +@@ -342,45 +342,7 @@ static PyThreadState *get_current_ts(void) |
5 | 38 |
|
6 | 39 | static PyGILState_STATE gil_ensure(void)
|
7 | 40 | {
|
|
0 commit comments