--- libs/mpi/src/python/datatypes.cpp.orig +++ libs/mpi/src/python/datatypes.cpp @@ -13,6 +13,10 @@ #include #include +#if PY_MAJOR_VERSION >= 3 +#define PyInt_Type PyLong_Type +#endif + namespace boost { namespace mpi { namespace python { void export_datatypes() --- libs/mpi/build/__init__.py.orig +++ libs/mpi/build/__init__.py @@ -6,5 +6,5 @@ import mpi sys.setdlopenflags(flags) else: - import mpi + from . import mpi --- libs/python/src/converter/builtin_converters.cpp.orig +++ libs/python/src/converter/builtin_converters.cpp @@ -45,11 +45,16 @@ { return PyString_Check(obj) ? PyString_AsString(obj) : 0; } -#else +#elif PY_VERSION_HEX < 0x03070000 void* convert_to_cstring(PyObject* obj) { return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0; } +#else + void* convert_to_cstring(PyObject* obj) + { + return PyUnicode_Check(obj) ? const_cast(reinterpret_cast(_PyUnicode_AsString(obj))) : 0; + } #endif // Given a target type and a SlotPolicy describing how to perform a