[Bf-blender-cvs] [85bbef0] master: python api internals: no need to set the stop-iter exception string.

Campbell Barton noreply at git.blender.org
Sun Nov 17 08:57:24 CET 2013


Commit: 85bbef0f4ea2e7cacf2f681367f34fb6037d1df1
Author: Campbell Barton
Date:   Sun Nov 17 15:09:57 2013 +1100
http://developer.blender.org/rB85bbef0f4ea2e7cacf2f681367f34fb6037d1df1

python api internals: no need to set the stop-iter exception string.

===================================================================

M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/bmesh/bmesh_py_types_select.c
M	source/blender/python/generic/idprop_py_api.c
M	source/blender/python/intern/bpy_rna.c
M	source/gameengine/Ketsji/KX_PythonSeq.cpp

===================================================================

diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 448f02a..97d88c5 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -2879,8 +2879,7 @@ static PyObject *bpy_bmiter_next(BPy_BMIter *self)
 {
 	BMHeader *ele = BM_iter_step(&self->iter);
 	if (ele == NULL) {
-		PyErr_SetString(PyExc_StopIteration,
-		                "bpy_bmiter_next stop");
+		PyErr_SetNone(PyExc_StopIteration);
 		return NULL;
 	}
 	else {
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index 5069670..1906fc8 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -341,8 +341,7 @@ static PyObject *bpy_bmeditseliter_next(BPy_BMEditSelIter *self)
 {
 	BMEditSelection *ese = self->ese;
 	if (ese == NULL) {
-		PyErr_SetString(PyExc_StopIteration,
-		                "bpy_bmiter_next stop");
+		PyErr_SetNone(PyExc_StopIteration);
 		return NULL;
 	}
 	else {
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index da13667..c3cbe7d 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -1397,7 +1397,7 @@ static PyObject *BPy_Group_Iter_Next(BPy_IDGroup_Iter *self)
 		}
 	}
 	else {
-		PyErr_SetString(PyExc_StopIteration, "iterator at end");
+		PyErr_SetNone(PyExc_StopIteration);
 		return NULL;
 	}
 }
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 4d4d487..5a87870 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -6044,7 +6044,7 @@ static PyObject *pyrna_prop_collection_iter(BPy_PropertyRNA *self)
 static PyObject *pyrna_prop_collection_iter_next(BPy_PropertyCollectionIterRNA *self)
 {
 	if (self->iter.valid == false) {
-		PyErr_SetString(PyExc_StopIteration, "pyrna_prop_collection_iter stop");
+		PyErr_SetNone(PyExc_StopIteration);
 		return NULL;
 	}
 	else {
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 247f417..ab4f2c2 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -383,7 +383,7 @@ static PyObject *KX_PythonSeq_nextIter(KX_PythonSeq *self)
 	self->iter++;
 	if ( object==NULL ) {
 		self->iter= -1; /* for reuse */
-		PyErr_SetString(PyExc_StopIteration,	"iterator at end");
+		PyErr_SetNone(PyExc_StopIteration);
 	}
 	return object; /* can be NULL for end of iterator */
 }




More information about the Bf-blender-cvs mailing list