Some minor improvements
* destroy/free/shutdown/close in reverse order of allocation * more static/auto_Xfree * less variables/strlen/GString * properly `\0`-terminate string of testcase Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
@@ -100,16 +100,13 @@ python_env_init(void)
|
||||
python_init_prof();
|
||||
|
||||
auto_gchar gchar* plugins_dir = files_get_data_path(DIR_PLUGINS);
|
||||
GString* path = g_string_new("import sys\n");
|
||||
g_string_append(path, "sys.path.append(\"");
|
||||
g_string_append(path, plugins_dir);
|
||||
g_string_append(path, "/\")\n");
|
||||
auto_gchar gchar* path = g_strdup_printf(
|
||||
"import sys\n"
|
||||
"sys.path.append(\"%s/\")\n", plugins_dir);
|
||||
|
||||
PyRun_SimpleString(path->str);
|
||||
PyRun_SimpleString(path);
|
||||
python_check_error();
|
||||
|
||||
g_string_free(path, TRUE);
|
||||
|
||||
allow_python_threads();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user