PyAPI: add imports arg to BPY_execute_string
[blender.git] / source / blender / windowmanager / intern / wm_files.c
index 87ca7310971a3748f5026421099bcfc53d7de48c..ef951010ba587a2865870039388e102a53e627d7 100644 (file)
@@ -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;