From cca3981b3f744136cd495e5ab9f1b41586e01c70 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 26 Apr 2021 11:04:53 +0200 Subject: [PATCH] Points: remove some more deprecated Py2 code --- src/Mod/Points/App/PointsPyImp.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/Mod/Points/App/PointsPyImp.cpp b/src/Mod/Points/App/PointsPyImp.cpp index bdf6609eda..b65d0ecc15 100644 --- a/src/Mod/Points/App/PointsPyImp.cpp +++ b/src/Mod/Points/App/PointsPyImp.cpp @@ -67,15 +67,9 @@ int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/) if (!addPoints(args)) return -1; } -#if PY_MAJOR_VERSION >= 3 else if (PyUnicode_Check(pcObj)) { getPointKernelPtr()->load(PyUnicode_AsUTF8(pcObj)); } -#else - else if (PyString_Check(pcObj)) { - getPointKernelPtr()->load(PyString_AsString(pcObj)); - } -#endif else { PyErr_SetString(PyExc_TypeError, "optional argument must be list, tuple or string"); return -1; @@ -188,11 +182,7 @@ PyObject* PointsPy::fromSegment(PyObject * args) pts->reserve(list.size()); int numPoints = static_cast(points->size()); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { -#if PY_MAJOR_VERSION < 3 - int index = static_cast(Py::Int(*it)); -#else long index = static_cast(Py::Long(*it)); -#endif if (index >= 0 && index < numPoints) pts->push_back(points->getPoint(index)); }