diff options
Diffstat (limited to 'release/scripts/modules/bpy_extras/keyconfig_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 4d5ec5286ec..eb727167d33 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -511,7 +511,7 @@ def keyconfig_import_from_data(name, keyconfig_data): def keyconfig_module_from_preset(name, preset_reference_filename=None): import os - import importlib.util + import bpy if preset_reference_filename is not None: preset_path = os.path.join(os.path.dirname(preset_reference_filename), name + ".py") else: @@ -521,11 +521,7 @@ def keyconfig_module_from_preset(name, preset_reference_filename=None): if not (preset_path and os.path.exists(preset_path)): preset_path = bpy.utils.preset_find(name, "keyconfig") - # module name isn't used or added to 'sys.modules'. - mod_spec = importlib.util.spec_from_file_location("__main__", preset_path) - mod = importlib.util.module_from_spec(mod_spec) - mod_spec.loader.exec_module(mod) - return mod + return bpy.utils.execfile(preset_path) # ----------------------------------------------------------------------------- |