Py2: fix Python 2 build failure

This commit is contained in:
wmayer
2020-06-12 16:02:13 +02:00
committed by wwmayer
parent 9fdd17675b
commit 8ed90c8586

View File

@@ -1841,11 +1841,19 @@ private:
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 {