diff options
Diffstat (limited to 'source')
-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 b54771f6b0e..58e277d9766 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -724,13 +724,13 @@ void bpy_module_delay_init(PyObject *bpy_proxy) { const int argc= 1; const char *argv[2]; - - const char *filename_rel= PyModule_GetFilename(bpy_proxy); /* can be relative */ + PyObject *filename_obj= PyModule_GetFilenameObject(bpy_proxy); /* updating the module dict below will loose the reference to __file__ */ + const char *filename_rel= _PyUnicode_AsString(filename_obj); /* can be relative */ char filename_abs[1024]; BLI_strncpy(filename_abs, filename_rel, sizeof(filename_abs)); BLI_path_cwd(filename_abs); - + argv[0]= filename_abs; argv[1]= NULL; |