gst-python: Fix API call for Python 3.13

_PyUnicode_AsString() is deprecated and PyUnicode_AsUTF8() should be used
instead. The new function was introduced in Python 3.3 and returns const
since Python 3.7, which is now required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5587>
This commit is contained in:
Gwyn Ciesla 2023-11-01 12:56:33 -05:00 committed by Nirbheek Chauhan
parent 34d221dad5
commit 2be13c82aa
2 changed files with 5 additions and 1 deletions

View file

@ -575,7 +575,7 @@ add_templates (gpointer gclass, PyObject * templates)
PyString_AsString (repr));
#else
PyErr_Format (PyExc_TypeError, "expected GObject but got %s",
_PyUnicode_AsString (repr));
PyUnicode_AsUTF8 (repr));
#endif
Py_DECREF (repr);

View file

@ -28,6 +28,10 @@ pythonver = python.language_version()
if pythonver.version_compare('<3.0')
error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))
endif
if pythonver.version_compare('<3.7')
error('Could not find a sufficient python version required: 3.7, found @0@'.format(python.language_version()))
endif
python_dep = python.dependency(embed:true, required : true)