From bd8a9eb1fd5e3047e7f5f519affc99e7304c627f Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 27 Aug 2010 17:28:26 +0000 Subject: [PATCH] Boost.Python: Python 3 compatibility patch by Trigve Siver (trac ticket 4497) [SVN r65055] --- include/boost/python/detail/operator_id.hpp | 3 +++ include/boost/python/operators.hpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/python/detail/operator_id.hpp b/include/boost/python/detail/operator_id.hpp index 25642fba..ecfc70f1 100644 --- a/include/boost/python/detail/operator_id.hpp +++ b/include/boost/python/detail/operator_id.hpp @@ -53,6 +53,9 @@ enum operator_id op_nonzero, #endif op_repr +#if PY_VERSION_HEX >= 0x03000000 + ,op_truediv +#endif }; }}} // namespace boost::python::detail diff --git a/include/boost/python/operators.hpp b/include/boost/python/operators.hpp index 9a60b344..ea2be7b9 100644 --- a/include/boost/python/operators.hpp +++ b/include/boost/python/operators.hpp @@ -212,7 +212,11 @@ namespace self_ns \ BOOST_PYTHON_BINARY_OPERATOR(add, radd, +) BOOST_PYTHON_BINARY_OPERATOR(sub, rsub, -) BOOST_PYTHON_BINARY_OPERATOR(mul, rmul, *) -BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) +#if PY_VERSION_HEX >= 0x03000000 + BOOST_PYTHON_BINARY_OPERATOR(truediv, rtruediv, /) +#else + BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) +#endif BOOST_PYTHON_BINARY_OPERATOR(mod, rmod, %) BOOST_PYTHON_BINARY_OPERATOR(lshift, rlshift, <<) BOOST_PYTHON_BINARY_OPERATOR(rshift, rrshift, >>)