diff --git a/test/a_map_indexing_suite.cpp b/test/a_map_indexing_suite.cpp index 30b5ea03..07a0a6b9 100644 --- a/test/a_map_indexing_suite.cpp +++ b/test/a_map_indexing_suite.cpp @@ -48,7 +48,11 @@ struct AFromPython static void* convertible(PyObject* obj_ptr) { +#if PY_VERSION_HEX >= 0x03000000 + if (!PyLong_Check(obj_ptr)) return 0; +#else if (!PyInt_Check(obj_ptr)) return 0; +#endif return obj_ptr; } @@ -60,7 +64,11 @@ struct AFromPython (boost::python::converter::rvalue_from_python_storage< A >*) data)-> storage.bytes; +#if PY_VERSION_HEX >= 0x03000000 + new (storage) A((int)PyLong_AsLong(obj_ptr)); +#else new (storage) A((int)PyInt_AsLong(obj_ptr)); +#endif data->convertible = storage; } }; diff --git a/test/map_indexing_suite.py b/test/map_indexing_suite.py index 01fa943d..9d9e2b26 100644 --- a/test/map_indexing_suite.py +++ b/test/map_indexing_suite.py @@ -197,7 +197,7 @@ kiwi >>> tm["kimpo"] = X("bbb") >>> print_xmap(tm) [ (joel, aaa) (kimpo, bbb) ] ->>> for el in tm: +>>> for el in tm: #doctest: +NORMALIZE_WHITESPACE ... print el.key(), ... dom = el.data() joel kimpo