Skip to content
Snippets Groups Projects
Commit 162ad2c7 authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot
Browse files

Merge topic '17350-python37-fix' into release


706f1b39 Fix compilation issue due to Python3.7 API change

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarDavid E. DeMarle <dave.demarle@kitware.com>
Merge-request: !4490
parents 2b149663 706f1b39
No related branches found
No related tags found
No related merge requests found
......@@ -95,13 +95,21 @@ bool vtkPythonGetStringValue(PyObject *o, T *&a, const char *exctext)
{
if (PyBytes_Check(o))
{
#if PY_VERSION_HEX >= 0x03070000
a = const_cast<char *>(PyBytes_AS_STRING(o));
return true;
#else
a = PyBytes_AS_STRING(o);
return true;
#endif
}
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(o))
{
#if PY_VERSION_HEX >= 0x03030000
#if PY_VERSION_HEX >= 0x03070000
a = const_cast<char *>(PyUnicode_AsUTF8(o));
return true;
#elif PY_VERSION_HEX >= 0x03030000
a = PyUnicode_AsUTF8(o);
return true;
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment