Skip to content

Commit

Permalink
Change to const_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnordlund authored Jul 3, 2018
1 parent 74b1565 commit c881adf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef std::unique_ptr<PyObject, PyObjectDeleter> PyObjPtr;
inline bool PyVimString_AsStringAndSize(PyObject* obj, char** data,
Py_ssize_t* size) {
#if PY_MAJOR_VERSION >= 3
*data = (char*)PyUnicode_AsUTF8AndSize(obj, size);
*data = const_cast<char *>(PyUnicode_AsUTF8AndSize(obj, size));
return *data != nullptr;
#else
return PyString_AsStringAndSize(obj, data, size) >= 0;
Expand Down

0 comments on commit c881adf

Please sign in to comment.