Fix return type of PyUnicodeAsUtf8Compat to const char* to precisely match to the return type of PyUnicode_AsUTF8.

PiperOrigin-RevId: 332504252
Change-Id: I08d5b53c6716a1195b66b93262aa190065eed053
This commit is contained in:
Kibeom Kim 2020-09-18 12:32:03 -07:00 committed by TensorFlower Gardener
parent effefef880
commit 637d6ebbdf

View File

@ -21,7 +21,7 @@ limitations under the License.
#include "tensorflow/python/lib/core/safe_pyobject_ptr.h"
namespace {
inline char* PyUnicodeAsUtf8Compat(PyObject* obj) {
inline const char* PyUnicodeAsUtf8Compat(PyObject* obj) {
#if PY_MAJOR_VERSION < 3
return PyString_AS_STRING(obj);
#else