diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-12 22:59:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-12 23:02:51 +0300 |
commit | 20d06eb3a85bc2930aef9a9d882d66905fb1fecf (patch) | |
tree | c08957924c5dbd17adcb210d665d170da6aad831 /release | |
parent | d23a53c74af7601d45f90b182bcde035ef0d691c (diff) |
WM: avoid string replace w/ appconfig-activate
Better construct an exact path, this would fail if the path exists
multiple times in the string.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 381e98c2940..53735ed3ece 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1417,10 +1417,10 @@ class WM_OT_appconfig_activate(Operator): def execute(self, context): import os - bpy.utils.keyconfig_set(self.filepath) - - filepath = self.filepath.replace("keyconfig", "interaction") - + filepath = self.filepath + bpy.utils.keyconfig_set(filepath) + dirname, filename = os.path.split(filepath) + filepath = os.path.normpath(os.path.join(dirname, os.pardir, "interaction", filename)) if os.path.exists(filepath): bpy.ops.script.execute_preset( filepath=filepath, |