@@ -337,20 +337,22 @@ PythonQt* PythonQt::self() { return _self; }
337337
338338PythonQt::PythonQt (int flags, const QByteArray& pythonQtModuleName)
339339{
340- #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8 && defined(__linux__)
340+ // #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8 && defined(__linux__)
341341/* Starting from python 3.8, python C extensions no longer link to libpython3.X.so
342- This is a problem, since libpython3.X.so is loaded through a reference in libtrikScriptRunner.so
342+ This is a possible problem, since libpython3.X.so is loaded through a reference in libtrikScriptRunner.so
343343 and (somehow) ld.so does not place it's symbols into global symbol table. This results into a failure to load any C module.
344344 Loading libpython3.X.so with dlopen and RTLD_GLOBAL flag effectively solves this issue. */
345345
346346// TODO: Someting like PyRun_String("sysconfig.get_config_var('LDLIBRARY')")
347347// should be used to extract shared object name for current interpreter
348- const auto &libName = QString (" libpython3.%1.so.1.0" ).arg (PY_MINOR_VERSION).toStdString ();
349- if (NULL == dlopen (libName.c_str (), RTLD_GLOBAL | RTLD_LAZY)) {
350- qFatal (" Failed to load %s" , libName.c_str ());
351- abort ();
352- }
353- #endif
348+
349+ // NOTE 2023-07-07: On Centos7 .so is a link named `libpython3.8.so` and points to `libpython3.8.so.rh-python38-1.0`
350+ // const auto &libName = QString("libpython3.%1.so.1.0").arg(PY_MINOR_VERSION).toStdString();
351+ // if (NULL == dlopen(libName.c_str(), RTLD_GLOBAL | RTLD_LAZY)) {
352+ // qFatal("Failed to load %s", libName.c_str());
353+ // abort();
354+ // }
355+ // #endif
354356 _p = new PythonQtPrivate;
355357 _p->_initFlags = flags;
356358
0 commit comments