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/editors/space_script
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/editors/space_script')
-rw-r--r--source/blender/editors/space_script/script_edit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 6bfb51d07c6..5a761d1cabf 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -125,7 +125,7 @@ static int script_reload_exec(bContext *C, wmOperator *op)
/* TODO, this crashes on netrender and keying sets, need to look into why
* disable for now unless running in debug mode */
WM_cursor_wait(1);
- BPY_execute_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
+ BPY_execute_string(C, (const char *[]){"bpy", NULL}, "bpy.utils.load_scripts(reload_scripts=True)");
WM_cursor_wait(0);
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;