Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-10 02:55:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-10 02:55:04 +0300
commit7efac2b0b09d9e76d9fc573ec7936a1c6440c067 (patch)
treef91a08c48c44f16879980c2803f63fd035bb8144 /source/blender/windowmanager/intern/wm_files.c
parent65e9388440a5d81811226760f61bdbca62a11396 (diff)
PyAPI: add imports arg to BPY_execute_string
Allows for avoiding `__import__` in expressions, was already supported for BPY_execute_string_as_* API calls.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 87ca7310971..ef951010ba5 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -473,10 +473,14 @@ static void wm_file_read_post(bContext *C, const bool is_startup_file, const boo
if (use_userdef) {
/* Only run when we have a template path found. */
if (BKE_appdir_app_template_any()) {
- BPY_execute_string(C, "__import__('bl_app_template_utils').reset()");
+ BPY_execute_string(
+ C, (const char *[]){"bl_app_template_utils", NULL},
+ "bl_app_template_utils.reset()");
}
/* sync addons, these may have changed from the defaults */
- BPY_execute_string(C, "__import__('addon_utils').reset_all()");
+ BPY_execute_string(
+ C, (const char *[]){"addon_utils", NULL},
+ "addon_utils.reset_all()");
}
BPY_python_reset(C);
addons_loaded = true;