diff --git a/src/python_extension.cc b/src/python_extension.cc index 9377536..bc81553 100644 --- a/src/python_extension.cc +++ b/src/python_extension.cc @@ -45,7 +45,7 @@ typedef std::unique_ptr PyObjPtr; inline bool PyVimString_AsStringAndSize(PyObject* obj, char** data, Py_ssize_t* size) { #if PY_MAJOR_VERSION >= 3 - *data = PyUnicode_AsUTF8AndSize(obj, size); + *data = const_cast(PyUnicode_AsUTF8AndSize(obj, size)); return *data != nullptr; #else return PyString_AsStringAndSize(obj, data, size) >= 0;