ethereon / lycon

A minimal and fast image library for Python and C++
Other
287 stars 27 forks source link

Update interop.cc #17

Closed aleozlx closed 6 years ago

aleozlx commented 6 years ago

This is to address issue #16 which has also occurred on Arch Linux with Python 3.7.0 & GCC 8.1.1. PyString_AsString is mapped to PyUnicode_AsUTF8 in src/lycon/python/compat.h for compatibility. And based on the function signiture const char* PyUnicode_AsUTF8(PyObject *unicode), I have prefixed const to make this correct. In Python2 it was defined to return char* however the content of the string mustn't be modified. This change is a backward compatible easy fix. Please consider merging soon. Thanks.

(Reference: https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsUTF8)

ethereon commented 6 years ago

Thanks for the fix