--- libs/mpi/src/python/datatypes.cpp.orig
+++ libs/mpi/src/python/datatypes.cpp
@@ -13,6 +13,10 @@
 #include <boost/mpi/python/serialize.hpp>
 #include <boost/mpi.hpp>
 
+#if PY_MAJOR_VERSION >= 3
+#define PyInt_Type PyLong_Type
+#endif
+
 namespace boost { namespace mpi { namespace python {
 
 void export_datatypes()
