py3: Gui: files P-Z ported to python3

This commit is contained in:
Yorik van Havre
2017-05-06 20:10:53 +02:00
committed by looooo
parent a3539c5168
commit 4f044dcbe4
4 changed files with 54 additions and 4 deletions

View File

@@ -181,7 +181,11 @@ PyObject* ViewProviderPy::listDisplayModes(PyObject *args)
int i=0;
for ( std::vector<std::string>::iterator it = modes.begin(); it != modes.end(); ++it ) {
#if PY_MAJOR_VERSION >= 3
PyObject* str = PyUnicode_FromString(it->c_str());
#else
PyObject* str = PyString_FromString(it->c_str());
#endif
PyList_SetItem(pyList, i++, str);
}