Skip to content

Commit

Permalink
initialize embedded python to UTF-8 mode only with Python >=3.8 (foll…
Browse files Browse the repository at this point in the history
…owup 61c7973)

(cherry picked from commit 65676da)
  • Loading branch information
jef-n committed Jun 25, 2021
1 parent e7eb189 commit 702c3be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/python/qgspythonutilsimpl.cpp
Expand Up @@ -162,6 +162,7 @@ bool QgsPythonUtilsImpl::checkSystemImports()

void QgsPythonUtilsImpl::init()
{
#if defined(PY_MAJOR_VERSION) && defined(PY_MINOR_VERSION) && ((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8) || PY_MAJOR_VERSION > 3)
PyStatus status;
PyPreConfig preconfig;
PyPreConfig_InitPythonConfig( &preconfig );
Expand All @@ -173,6 +174,7 @@ void QgsPythonUtilsImpl::init()
{
Py_ExitStatusException( status );
}
#endif

// initialize python
Py_Initialize();
Expand Down

0 comments on commit 702c3be

Please sign in to comment.