diff --git a/Libs/swig/VisusPy.common b/Libs/swig/VisusPy.common index b8cb90cf..ef1c98b3 100644 --- a/Libs/swig/VisusPy.common +++ b/Libs/swig/VisusPy.common @@ -54,13 +54,13 @@ For support : support@visus.net #include + static String convertToString(PyObject* value) { if (!value) return ""; PyObject* py_str = PyObject_Str(value); - auto tmp = SWIG_Python_str_AsChar(py_str); + const char* tmp = py_str? PyUnicode_AsUTF8(py_str) : nullptr; //cit "The caller is not responsible for deallocating the buffer." String ret = tmp ? tmp : ""; - SWIG_Python_str_DelForPy3(tmp); Py_DECREF(py_str); return ret; }