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_interface.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_interface.c')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 311612e1499..9fea65935e1 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -585,8 +585,8 @@ void BPY_python_backtrace(FILE *fp) PyFrameObject *frame = tstate->frame; do { const int line = PyCode_Addr2Line(frame->f_code, frame->f_lasti); - const char *filename = _PyUnicode_AsString(frame->f_code->co_filename); - const char *funcname = _PyUnicode_AsString(frame->f_code->co_name); + const char *filename = PyUnicode_AsUTF8(frame->f_code->co_filename); + const char *funcname = PyUnicode_AsUTF8(frame->f_code->co_name); fprintf(fp, " File \"%s\", line %d in %s\n", filename, line, funcname); } while ((frame = frame->f_back)); } @@ -778,7 +778,7 @@ static void bpy_module_delay_init(PyObject *bpy_proxy) /* updating the module dict below will lose the reference to __file__ */ PyObject *filename_obj = PyModule_GetFilenameObject(bpy_proxy); - const char *filename_rel = _PyUnicode_AsString(filename_obj); /* can be relative */ + const char *filename_rel = PyUnicode_AsUTF8(filename_obj); /* can be relative */ char filename_abs[1024]; BLI_strncpy(filename_abs, filename_rel, sizeof(filename_abs)); |