Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-13 14:57:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-13 15:09:55 +0300
commitdae445d94a7a5e1ad38719ea05e5bb0bc76ede84 (patch)
tree5f174cb170079ac62eaf521cb3cec2535162e6bf /source/blender/python/gpu
parent32660201acaa1138c0fed6ef3fa38f69daa3dac3 (diff)
Fix T85573: Building with Python 3.10a5 fails
Replace deprecated _PyUnicode_AsString{AndSize} usage. T83626 still needs to be resolved before 3.10 is usable.
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r--source/blender/python/gpu/gpu_py_api.c2
-rw-r--r--source/blender/python/gpu/gpu_py_vertex_format.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c
index 954118ffa5f..eb2fd1f7304 100644
--- a/source/blender/python/gpu/gpu_py_api.c
+++ b/source/blender/python/gpu/gpu_py_api.c
@@ -64,7 +64,7 @@ bool bpygpu_is_init_or_error(void)
int bpygpu_ParsePrimType(PyObject *o, void *p)
{
Py_ssize_t mode_id_len;
- const char *mode_id = _PyUnicode_AsStringAndSize(o, &mode_id_len);
+ const char *mode_id = PyUnicode_AsUTF8AndSize(o, &mode_id_len);
if (mode_id == NULL) {
PyErr_Format(PyExc_ValueError, "expected a string, got %s", Py_TYPE(o)->tp_name);
return 0;
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c
index 7d1e4ee4868..52e1a720f97 100644
--- a/source/blender/python/gpu/gpu_py_vertex_format.c
+++ b/source/blender/python/gpu/gpu_py_vertex_format.c
@@ -105,7 +105,7 @@ static int py_parse_fetch_mode(const char *str, int length)
static int py_ParseVertCompType(PyObject *o, void *p)
{
Py_ssize_t length;
- const char *str = _PyUnicode_AsStringAndSize(o, &length);
+ const char *str = PyUnicode_AsUTF8AndSize(o, &length);
if (str == NULL) {
PyErr_Format(PyExc_ValueError, "expected a string, got %s", Py_TYPE(o)->tp_name);
@@ -125,7 +125,7 @@ static int py_ParseVertCompType(PyObject *o, void *p)
static int py_ParseVertFetchMode(PyObject *o, void *p)
{
Py_ssize_t length;
- const char *str = _PyUnicode_AsStringAndSize(o, &length);
+ const char *str = PyUnicode_AsUTF8AndSize(o, &length);
if (str == NULL) {
PyErr_Format(PyExc_ValueError, "expected a string, got %s", Py_TYPE(o)->tp_name);