diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-13 14:57:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-13 15:09:55 +0300 |
commit | dae445d94a7a5e1ad38719ea05e5bb0bc76ede84 (patch) | |
tree | 5f174cb170079ac62eaf521cb3cec2535162e6bf /source/blender/python/intern/bpy_app_translations.c | |
parent | 32660201acaa1138c0fed6ef3fa38f69daa3dac3 (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/intern/bpy_app_translations.c')
-rw-r--r-- | source/blender/python/intern/bpy_app_translations.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index 56fc3efc090..d00f205ddc0 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -211,7 +211,7 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale) msgctxt = BLT_I18NCONTEXT_DEFAULT_BPYRNA; } else if (PyUnicode_Check(tmp)) { - msgctxt = _PyUnicode_AsString(tmp); + msgctxt = PyUnicode_AsUTF8(tmp); } else { invalid_key = true; @@ -219,7 +219,7 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale) tmp = PyTuple_GET_ITEM(pykey, 1); if (PyUnicode_Check(tmp)) { - msgid = _PyUnicode_AsString(tmp); + msgid = PyUnicode_AsUTF8(tmp); } else { invalid_key = true; @@ -250,7 +250,7 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale) /* Do not overwrite existing keys! */ if (BPY_app_translations_py_pgettext(msgctxt, msgid) == msgid) { GHashKey *key = _ghashutil_keyalloc(msgctxt, msgid); - BLI_ghash_insert(_translations_cache, key, BLI_strdup(_PyUnicode_AsString(trans))); + BLI_ghash_insert(_translations_cache, key, BLI_strdup(PyUnicode_AsUTF8(trans))); } } } @@ -341,7 +341,7 @@ static PyObject *app_translations_py_messages_register(BlenderAppTranslations *s PyExc_ValueError, "bpy.app.translations.register: translations message cache already contains some data for " "addon '%s'", - (const char *)_PyUnicode_AsString(module_name)); + (const char *)PyUnicode_AsUTF8(module_name)); return NULL; } |