Skip to content

Commit

Permalink
Py2: fix Python 2 build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jun 12, 2020
1 parent 9fdd176 commit 8ed90c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Mod/Part/App/AppPartPy.cpp
Expand Up @@ -1841,11 +1841,19 @@ class Module : public Py::ExtensionModule<Module>
if (!p) {
throw Py::TypeError("** makeWireString can't convert PyString.");
}
#if PY_VERSION_HEX >= 0x03030000
pysize = PyUnicode_GetLength(p);
#else
pysize = PyUnicode_GetSize(p);
#endif
unichars = PyUnicode_AS_UNICODE(p);
}
else if (PyUnicode_Check(intext)) {
#if PY_VERSION_HEX >= 0x03030000
pysize = PyUnicode_GetLength(intext);
#else
pysize = PyUnicode_GetSize(intext);
#endif
unichars = PyUnicode_AS_UNICODE(intext);
}
else {
Expand Down

0 comments on commit 8ed90c8

Please sign in to comment.