Fix runtime compatibility with newer Python versions

Initial patch by Asser. Change restricted to Python 3.3 and above by me as PyUnicode_DecodeFSDefault was added in 3.3.
pull/3/head
Asser Schrøder Femø 2016-06-20 10:51:46 +01:00 committed by Dave Page
parent dd4705af60
commit fc955537a8
1 changed files with 4 additions and 0 deletions

View File

@ -126,8 +126,12 @@ Server::Server(quint16 port)
{
#ifdef PYTHON2
PyList_Append(sysPath, PyString_FromString(path_list.at(i).toUtf8().data()));
#else
#if PY_MINOR_VERSION > 2
PyList_Append(sysPath, PyUnicode_DecodeFSDefault(path_list.at(i).toUtf8().data()));
#else
PyList_Append(sysPath, PyBytes_FromString(path_list.at(i).toUtf8().data()));
#endif
#endif
}
}