Sketcher: remove Py2 code from Sketcher wb

This commit is contained in:
luz paz
2021-04-21 22:12:07 -04:00
committed by wwmayer
parent 738a697d94
commit 9e6fe284ed
2 changed files with 0 additions and 75 deletions

View File

@@ -227,13 +227,8 @@ PyObject* SketchObjectPy::delGeometries(PyObject *args)
std::vector<int> geoIdList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check((*it).ptr()))
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
#else
if (PyInt_Check((*it).ptr()))
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
#endif
}
if(this->getSketchObjectPtr()->delGeometries(geoIdList)) {
@@ -1139,13 +1134,8 @@ PyObject* SketchObjectPy::addSymmetric(PyObject *args)
std::vector<int> geoIdList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check((*it).ptr()))
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
#else
if (PyInt_Check((*it).ptr()))
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
#endif
}
int ret = this->getSketchObjectPtr()->addSymmetric(geoIdList,refGeoId,(Sketcher::PointPos) refPosId) + 1;
@@ -1183,13 +1173,8 @@ PyObject* SketchObjectPy::addCopy(PyObject *args)
std::vector<int> geoIdList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check((*it).ptr()))
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
#else
if (PyInt_Check((*it).ptr()))
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
#endif
}
try {
@@ -1232,13 +1217,8 @@ PyObject* SketchObjectPy::addMove(PyObject *args)
std::vector<int> geoIdList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check((*it).ptr()))
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
#else
if (PyInt_Check((*it).ptr()))
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
#endif
}
this->getSketchObjectPtr()->addCopy(geoIdList, vect, true);
@@ -1270,13 +1250,8 @@ PyObject* SketchObjectPy::addRectangularArray(PyObject *args)
std::vector<int> geoIdList;
Py::Sequence list(pcObj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
#if PY_MAJOR_VERSION >= 3
if (PyLong_Check((*it).ptr()))
geoIdList.push_back(PyLong_AsLong((*it).ptr()));
#else
if (PyInt_Check((*it).ptr()))
geoIdList.push_back(PyInt_AsLong((*it).ptr()));
#endif
}
try {