Revert "remove unused python<3.6 code"

This reverts commit 0a6d271121.
This commit is contained in:
Uwe
2022-06-19 16:23:13 +02:00
parent 60e419068b
commit 9fcb98d9c6
2 changed files with 13 additions and 5 deletions

View File

@@ -1912,8 +1912,11 @@ 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
#if PY_VERSION_HEX < 0x03090000
unichars = PyUnicode_AS_UNICODE(p);
#else
@@ -1921,8 +1924,11 @@ private:
#endif
}
else if (PyUnicode_Check(intext)) {
#if PY_VERSION_HEX >= 0x03030000
pysize = PyUnicode_GetLength(intext);
#else
pysize = PyUnicode_GetSize(intext);
#endif
#if PY_VERSION_HEX < 0x03090000
unichars = PyUnicode_AS_UNICODE(intext);
#else