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:
parent
b138f054e5
commit
0769e9b727
5 changed files with 30 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue