Skip to content
Permalink
Browse files
initialize embedded python to UTF-8 mode only with Python >=3.8 (foll…
…owup 61c7973)

(cherry picked from commit 65676da)
  • Loading branch information
jef-n committed Jun 25, 2021
1 parent 2f778dc commit 502a13d3cbead15c9913400c15f630b6cf2455ab
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/python/qgspythonutilsimpl.cpp
@@ -154,6 +154,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 );
@@ -165,6 +166,7 @@ void QgsPythonUtilsImpl::init()
{
Py_ExitStatusException( status );
}
#endif

// initialize python
Py_Initialize();

0 comments on commit 502a13d

Please sign in to comment.