diff --git a/include/eigenpy/quaternion.hpp b/include/eigenpy/quaternion.hpp
index a1210137ab31fb706cbe1f0fc1d5838f330568d0..af04779654b3e0db6877d2ad12477685f7bf6bd9 100644
--- a/include/eigenpy/quaternion.hpp
+++ b/include/eigenpy/quaternion.hpp
@@ -350,7 +350,7 @@ class QuaternionVisitor
 
  public:
   static void expose() {
-#if BOOST_VERSION / 100 % 1000 < 71
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 6
     typedef EIGENPY_SHARED_PTR_HOLDER_TYPE(Quaternion) HolderType;
 #else
     typedef ::boost::python::detail::not_specified HolderType;