Skip to content
Snippets Groups Projects
Commit 5b9d2850 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #24597. Check against v2 python.

parent 3c8377a3
No related merge requests found
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#define FROM_CSTRING PyUnicode_FromString #define FROM_CSTRING PyUnicode_FromString
#define CODE_OBJECT(x) x #define CODE_OBJECT(x) x
#else #else
#define IS_PY2K
#define INT_CHECK PyInt_Check #define INT_CHECK PyInt_Check
#define TO_LONG PyInt_AsLong #define TO_LONG PyInt_AsLong
#define STR_CHECK PyString_Check #define STR_CHECK PyString_Check
......
...@@ -19,10 +19,10 @@ void export_ComponentInfoPythonIterator() { ...@@ -19,10 +19,10 @@ void export_ComponentInfoPythonIterator() {
// Export to Python // Export to Python
class_<ComponentInfoPythonIterator>("ComponentInfoPythonIterator", no_init) class_<ComponentInfoPythonIterator>("ComponentInfoPythonIterator", no_init)
.def("__iter__", objects::identity_function()) .def("__iter__", objects::identity_function())
#ifdef IS_PY3K #ifdef IS_PY2K
.def("__next__", &ComponentInfoPythonIterator::next)
#else
.def("next", &ComponentInfoPythonIterator::next) .def("next", &ComponentInfoPythonIterator::next)
#else
.def("__next__", &ComponentInfoPythonIterator::next)
#endif #endif
; ;
} }
...@@ -19,10 +19,10 @@ void export_DetectorInfoPythonIterator() { ...@@ -19,10 +19,10 @@ void export_DetectorInfoPythonIterator() {
// Export to Python // Export to Python
class_<DetectorInfoPythonIterator>("DetectorInfoPythonIterator", no_init) class_<DetectorInfoPythonIterator>("DetectorInfoPythonIterator", no_init)
.def("__iter__", objects::identity_function()) .def("__iter__", objects::identity_function())
#ifdef IS_PY3K #ifdef IS_PY2K
.def("__next__", &DetectorInfoPythonIterator::next)
#else
.def("next", &DetectorInfoPythonIterator::next) .def("next", &DetectorInfoPythonIterator::next)
#else
.def("__next__", &DetectorInfoPythonIterator::next)
#endif #endif
; ;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment