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 branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@
#define FROM_CSTRING PyUnicode_FromString
#define CODE_OBJECT(x) x
#else
#define IS_PY2K
#define INT_CHECK PyInt_Check
#define TO_LONG PyInt_AsLong
#define STR_CHECK PyString_Check
......
......@@ -19,10 +19,10 @@ void export_ComponentInfoPythonIterator() {
// Export to Python
class_<ComponentInfoPythonIterator>("ComponentInfoPythonIterator", no_init)
.def("__iter__", objects::identity_function())
#ifdef IS_PY3K
.def("__next__", &ComponentInfoPythonIterator::next)
#else
#ifdef IS_PY2K
.def("next", &ComponentInfoPythonIterator::next)
#else
.def("__next__", &ComponentInfoPythonIterator::next)
#endif
;
}
......@@ -19,10 +19,10 @@ void export_DetectorInfoPythonIterator() {
// Export to Python
class_<DetectorInfoPythonIterator>("DetectorInfoPythonIterator", no_init)
.def("__iter__", objects::identity_function())
#ifdef IS_PY3K
.def("__next__", &DetectorInfoPythonIterator::next)
#else
#ifdef IS_PY2K
.def("next", &DetectorInfoPythonIterator::next)
#else
.def("__next__", &DetectorInfoPythonIterator::next)
#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