Cleanup: remove redundant static variable use

This hasn't been needed since Python 3.7x.
This commit is contained in:
Campbell Barton 2020-07-23 13:52:52 +10:00
parent 797820fc20
commit 19afb0ea67
2 changed files with 8 additions and 6 deletions

View File

@ -841,7 +841,7 @@ void PyC_SetHomePath(const char *py_path_bundle)
# endif
{
static wchar_t py_path_bundle_wchar[1024];
wchar_t py_path_bundle_wchar[1024];
/* Can't use this, on linux gives bug: #23018,
* TODO: try LANG="en_US.UTF-8" /usr/bin/blender, suggested 2008 */

View File

@ -258,11 +258,13 @@ void BPY_python_start(int argc, const char **argv)
PyThreadState *py_tstate = NULL;
const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, NULL);
/* not essential but nice to set our name */
static wchar_t program_path_wchar[FILE_MAX]; /* python holds a reference */
BLI_strncpy_wchar_from_utf8(
program_path_wchar, BKE_appdir_program_path(), ARRAY_SIZE(program_path_wchar));
Py_SetProgramName(program_path_wchar);
/* Not essential but nice to set our name. */
{
const char *program_path = BKE_appdir_program_path();
wchar_t program_path_wchar[FILE_MAX];
BLI_strncpy_wchar_from_utf8(program_path_wchar, program_path, ARRAY_SIZE(program_path_wchar));
Py_SetProgramName(program_path_wchar);
}
/* must run before python initializes */
PyImport_ExtendInittab(bpy_internal_modules);