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/intern
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/intern')
-rw-r--r--source/blender/python/intern/bpy_rna.c4
1 files changed, 2 insertions, 2 deletions
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) {