Gui: remove some more deprecated Py2

This commit is contained in:
wmayer
2021-04-26 10:59:32 +02:00
parent 44e82ac3c4
commit 1aad309886
2 changed files with 1 additions and 7 deletions

View File

@@ -1144,16 +1144,12 @@ PyObject* Application::sAddCommand(PyObject * /*self*/, PyObject *args)
std::string file;
// usually this is the file name of the calling script
#if (PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION==3 && PY_MINOR_VERSION>=5))
Py::Object info = list.getItem(0);
PyObject *pyfile = PyStructSequence_GET_ITEM(*info,1);
if(!pyfile)
throw Py::Exception();
file = Py::Object(pyfile).as_string();
#else
Py::Tuple info = list.getItem(0);
file = info.getItem(1).as_string();
#endif
Base::FileInfo fi(file);
// convert backslashes to slashes
file = fi.filePath();