This is an automated email from the ASF dual-hosted git repository. jdanek pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/main by this push: new ad53d675 DISPATCH-2360: call Py_Initialize before any other python C (#1671) ad53d675 is described below commit ad53d675d2d2a3f51af7baa82483ee00cbca1f1d Author: Jiri Daněk <jda...@redhat.com> AuthorDate: Sat Dec 2 21:51:12 2023 +0100 DISPATCH-2360: call Py_Initialize before any other python C (#1671) This is a backport of a skupper-router fix from * https://github.com/skupperproject/skupper-router/pull/1307 --- src/python_embedded.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_embedded.c b/src/python_embedded.c index a7e40bce..896516ef 100644 --- a/src/python_embedded.c +++ b/src/python_embedded.c @@ -50,13 +50,13 @@ void qd_python_initialize(qd_dispatch_t *qd, const char *python_pkgdir) { log_source = qd_log_source("PYTHON"); dispatch = qd; - if (python_pkgdir) - dispatch_python_pkgdir = PyUnicode_FromString(python_pkgdir); Py_Initialize(); #if PY_VERSION_HEX < 0x03070000 PyEval_InitThreads(); // necessary for Python 3.6 and older versions #endif + if (python_pkgdir) + dispatch_python_pkgdir = PyUnicode_FromString(python_pkgdir); qd_python_setup(); PyEval_SaveThread(); // drop the Python GIL; we will reacquire it in other threads as needed } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org