Fix iterators for containers of NULL pointers (or Python None) when using -builtin.

Previously iteration would stop at the first element that had a NULL pointer value.
This commit is contained in:
William S Fulton 2016-09-17 17:53:48 +01:00
commit 0769e9b727
5 changed files with 30 additions and 14 deletions

View file

@ -199,18 +199,6 @@ wrapper##_closure(PyObject *a) { \
return result; \
}
#define SWIGPY_ITERNEXT_CLOSURE(wrapper) \
SWIGINTERN PyObject * \
wrapper##_closure(PyObject *a) { \
PyObject *result; \
result = wrapper(a, NULL); \
if (result && result == Py_None) { \
Py_DECREF(result); \
result = NULL; \
} \
return result; \
}
#ifdef __cplusplus
extern "C" {
#endif