Gui: remove Py2 code from several src/Gui .cpp files

This commit is contained in:
luz paz
2021-04-12 10:56:27 -04:00
committed by wmayer
parent cc7f36599e
commit a213071c87
10 changed files with 1 additions and 191 deletions

View File

@@ -737,11 +737,7 @@ PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args)
return NULL;
std::string locale = Translator::instance()->activeLanguage();
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromString(locale.c_str());
#else
return PyString_FromString(locale.c_str());
#endif
}
PyObject* Application::sSetLocale(PyObject * /*self*/, PyObject *args)
@@ -819,11 +815,7 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args)
PyObject* dlg;
// old style classes
#if PY_MAJOR_VERSION >= 3
if (PyArg_ParseTuple(args, "O!s", &PyType_Type, &dlg, &grp)) {
#else
if (PyArg_ParseTuple(args, "O!s", &PyClass_Type, &dlg, &grp)) {
#endif
// add to the preferences dialog
new PrefPagePyProducer(Py::Object(dlg), grp);