fix passing explicit None slice indices into the getslice code, enable test case...
authorStefan Behnel <stefan_ml@behnel.de>
Sat, 16 Mar 2013 16:09:40 +0000 (17:09 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sat, 16 Mar 2013 16:09:40 +0000 (17:09 +0100)
--HG--
rename : tests/run/slice2_T636.pyx => tests/run/slice2_T636.py

Cython/Utility/ObjectHandling.c
tests/bugs.txt
tests/run/slice2_T636.py [moved from tests/run/slice2_T636.pyx with 100% similarity]

index 3d3729a..594624c 100644 (file)
@@ -463,14 +463,14 @@ static CYTHON_INLINE PyObject* __Pyx_PySequence_GetObjectSlice(
     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
     if (likely(ms && ms->sq_slice)) {
         if (!has_cstart) {
-            if (_py_start) {
+            if (_py_start && (*_py_start != Py_None)) {
                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) return NULL;
             } else
                 cstart = 0;
         }
         if (!has_cstop) {
-            if (_py_stop) {
+            if (_py_stop && (*_py_stop != Py_None)) {
                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) return NULL;
             } else
@@ -565,14 +565,14 @@ static CYTHON_INLINE int __Pyx_PySequence_SetObjectSlice(
     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
     if (likely(ms && ms->sq_ass_slice)) {
         if (!has_cstart) {
-            if (_py_start) {
+            if (_py_start && (*_py_start != Py_None)) {
                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
             } else
                 cstart = 0;
         }
         if (!has_cstop) {
-            if (_py_stop) {
+            if (_py_stop && (*_py_stop != Py_None)) {
                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
             } else
index f368fcc..dd84610 100644 (file)
@@ -11,7 +11,6 @@ genexpr_iterable_lookup_T600
 generator_expressions_in_class
 for_from_pyvar_loop_T601
 temp_sideeffects_T654    # not really a bug, Cython warns about it
-slice2_T636
 inherited_final_method
 tryfinallychaining        # also see FIXME in "yield_from_pep380" test