py3: port external FreeCAD module to Python3

issue 0000995
This commit is contained in:
wmayer
2017-06-02 06:39:06 +02:00
committed by looooo
parent f072d2e627
commit d40d68d0cb
3 changed files with 71 additions and 37 deletions

View File

@@ -201,7 +201,11 @@ int main( int argc, char ** argv )
"Python is searching for its files in the following directories:\n%3\n\n"
"Python version information:\n%4\n")
.arg(appName).arg(QString::fromUtf8(e.what()))
#if PY_MAJOR_VERSION >= 3
.arg(QString::fromUtf8(Py_EncodeLocale(Py_GetPath(),NULL))).arg(QString::fromLatin1(Py_GetVersion()));
#else
.arg(QString::fromUtf8(Py_GetPath())).arg(QString::fromLatin1(Py_GetVersion()));
#endif
const char* pythonhome = getenv("PYTHONHOME");
if (pythonhome) {
msg += QObject::tr("\nThe environment variable PYTHONHOME is set to '%1'.")