From 998e13ea881b9f8a3eae3581ef478ce556ff3677 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 7 Nov 2024 09:23:14 +0100 Subject: [PATCH] Py_SetPath removed from Python 3.13. We should upgrade to use PyConfig, but too late in the release cycle --- python/engine/PythonEngine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/engine/PythonEngine.cpp b/python/engine/PythonEngine.cpp index 97e12250ba..a9b9514011 100644 --- a/python/engine/PythonEngine.cpp +++ b/python/engine/PythonEngine.cpp @@ -25,6 +25,17 @@ # pragma GCC diagnostic pop #endif +// >= 3.13.0 +// #if PY_VERSION_HEX >= 0x30d0000 +#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 12) +extern "C" +{ + // These functions was removed from Python 3.13 API but are still exported + // for the stable ABI. Until we upgrade to PyConfig, just keep using it + extern void Py_SetPath(const wchar_t* path); +} +#endif + namespace openstudio { void addToPythonPath(const openstudio::path& includePath) {