[TD] remove Py2 code from TD

This commit is contained in:
luz paz
2021-04-21 22:06:59 -04:00
committed by wwmayer
parent ba99b72984
commit 738a697d94
11 changed files with 0 additions and 91 deletions

View File

@@ -321,17 +321,10 @@ void CenterLinePy::setEdges(Py::Object arg)
int i = 0;
for ( ; i < tSize; i++) {
PyObject* item = PyList_GetItem(pList, (Py_ssize_t) i);
#if PY_MAJOR_VERSION >= 3
if (PyUnicode_Check(item)) {
std::string s = PyUnicode_AsUTF8(item); //py3 only!!!
temp.push_back(s);
}
#else
if (PyString_Check(item)) {
std::string s = PyString_AsString(item); //py2 only!!!
temp.push_back(s);
}
#endif
}
cl->m_edges = temp;
} else {
@@ -367,17 +360,10 @@ void CenterLinePy::setFaces(Py::Object arg)
int i = 0;
for ( ; i < tSize; i++) {
PyObject* item = PyList_GetItem(pList, (Py_ssize_t) i);
#if PY_MAJOR_VERSION >= 3
if (PyUnicode_Check(item)) {
std::string s = PyUnicode_AsUTF8(item); //py3 only!!!
temp.push_back(s);
}
#else
if (PyString_Check(item)) {
std::string s = PyString_AsString(item); //py2 only!!!
temp.push_back(s);
}
#endif
}
cl->m_faces = temp;
} else {
@@ -414,17 +400,10 @@ void CenterLinePy::setPoints(Py::Object arg)
int i = 0;
for ( ; i < tSize; i++) {
PyObject* item = PyList_GetItem(pList, (Py_ssize_t) i);
#if PY_MAJOR_VERSION >= 3
if (PyUnicode_Check(item)) {
std::string s = PyUnicode_AsUTF8(item); //py3 only!!!
temp.push_back(s);
}
#else
if (PyString_Check(item)) {
std::string s = PyString_AsString(item); //py2 only!!!
temp.push_back(s);
}
#endif
}
cl->m_verts = temp;
} else {