[python] Checking Python version

How do I check the Python major version in code when using Boost.Python ? I know there is a way to do it through a preprocessor define by including the CPathon patchlevel.h file but I would rather not include low-level Python files if Boost.Python has some way of doing it.

AMDG On 10/18/2018 10:07 AM, Edward Diener via Boost wrote:
How do I check the Python major version in code when using Boost.Python ? I know there is a way to do it through a preprocessor define by including the CPathon patchlevel.h file but I would rather not include low-level Python files if Boost.Python has some way of doing it.
I don't see why it matters. It's not going to be more portable and BOOST_PYTHON_XXX is hardly a better abstraction than PY_XXX. In Christ, Steven Watanabe
participants (2)
-
Edward Diener
-
Steven Watanabe