build: Fix type mismatch due to Python 3.7 API change

This commit is contained in:
Tom Henderson
2018-08-24 18:06:28 -07:00
parent 12a3af0e02
commit 16570e0079

View File

@@ -62,7 +62,7 @@ PyObject *item = PyList_GET_ITEM(%(py_name)s, %(idx)s);
'"argument %s must be a list of strings");') % self.name)
wrapper.before_call.write_code(
'#if PY_VERSION_HEX >= 0x03000000\n'
'{var}[{idx}] = PyUnicode_AsUTF8(item);\n'
'{var}[{idx}] = const_cast<char *> (PyUnicode_AsUTF8(item));\n'
'#else\n'
'{var}[{idx}] = PyString_AsString(item);\n'
'#endif\n'