diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 746b383373..13016c977f 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -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(); diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index 21c54845d1..93c263d85e 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -159,12 +159,10 @@ int main( int argc, char ** argv ) } #endif -#if PY_MAJOR_VERSION >= 3 #if defined(_MSC_VER) && _MSC_VER <= 1800 // See InterpreterSingleton::init Redirection out(stdout), err(stderr), inp(stdin); #endif -#endif // PY_MAJOR_VERSION // Name and Version of the Application App::Application::Config()["ExeName"] = "FreeCAD";