Python 3.7 compatability
authorilovezfs <ilovezfs@icloud.com>
Tue, 3 Jul 2018 06:31:39 +0000 (06:31 +0000)
committerilovezfs <ilovezfs@icloud.com>
Tue, 3 Jul 2018 07:38:59 +0000 (00:38 -0700)
The result of PyUnicode_AsUTF8() is now of type const char * rather of
char *.

modules/python/src2/cv2.cpp

index e16fcba..5a6bf7e 100644 (file)
@@ -916,7 +916,7 @@ bool pyopencv_to(PyObject* obj, String& value, const char* name)
     (void)name;
     if(!obj || obj == Py_None)
         return true;
-    char* str = PyString_AsString(obj);
+    const char* str = PyString_AsString(obj);
     if(!str)
         return false;
     value = String(str);