From 6a3914fcf6268903b01c265b82aadfc34fcd36d7 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 14 Jul 2018 20:32:13 +0000 Subject: [PATCH] Fixed pya.cc build with Py3/Linux --- src/pya/pya/pya.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 93fb9354b..044151f4e 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -250,13 +250,8 @@ PythonInterpreter::PythonInterpreter () const char *python_path = getenv ("KLAYOUT_PYTHONPATH"); if (python_path) { - QString path = QString::fromLocal8Bit (python_path); - - if (sizeof (wchar_t) == 4) { - Py_SetPath ((const wchar_t *) path.toUcs4 ().constData ()); - } else if (sizeof (wchar_t) == 2) { - Py_SetPath ((const wchar_t *) path.utf16 ()); - } + std::wstring path = tl::to_wstring (tl::to_string_from_local (python_path)); + Py_SetPath (path.c_str ()); }