Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-26 03:41:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-26 03:41:32 +0400
commit95002a98bfab3ccad94134fc8bbedab19cd0289f (patch)
tree0eecb647d8b40087c65f354648631d20d74ca24e /source/blender/python
parentd08abbee694166429f67d59f6d86962b8d1bed4e (diff)
fix for very bad bug with python list slicing which - in bmesh and bpy api for all? 2.5x + releases.
negative stop values when slicing was broken. eg. bpy.data.objects[0:-2] != list(bpy.data.objects)[0:-2]
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index d7d9baf35ed..f1fe70d0848 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -2581,7 +2581,7 @@ static PyObject *bpy_bmelemseq_subscript(BPy_BMElemSeq *self, PyObject *key)
/* only get the length for negative values */
Py_ssize_t len = bpy_bmelemseq_length(self);
if (start < 0) start += len;
- if (stop < 0) start += len;
+ if (stop < 0) stop += len;
}
if (stop - start <= 0) {
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index e45a39a0643..2a9592d21e2 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -685,7 +685,7 @@ static PyObject *bpy_bmlayercollection_subscript(BPy_BMLayerCollection *self, Py
/* only get the length for negative values */
Py_ssize_t len = bpy_bmlayercollection_length(self);
if (start < 0) start += len;
- if (stop < 0) start += len;
+ if (stop < 0) stop += len;
}
if (stop - start <= 0) {
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index c3adc8366bd..85095596a4e 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -280,7 +280,7 @@ static PyObject *bpy_bmeditselseq_subscript(BPy_BMEditSelSeq *self, PyObject *ke
/* only get the length for negative values */
Py_ssize_t len = bpy_bmeditselseq_length(self);
if (start < 0) start += len;
- if (stop < 0) start += len;
+ if (stop < 0) stop += len;
}
if (stop - start <= 0) {
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 8ec8c4c41ba..a9767303b98 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2420,7 +2420,7 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
/* only get the length for negative values */
Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
if (start < 0) start += len;
- if (stop < 0) start += len;
+ if (stop < 0) stop += len;
}
if (stop - start <= 0) {
@@ -2546,7 +2546,7 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *
/* only get the length for negative values */
Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
if (start < 0) start += len;
- if (stop < 0) start += len;
+ if (stop < 0) stop += len;
}
if (stop - start <= 0) {