diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-13 03:03:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-13 05:35:18 +0300 |
commit | be1e61b09352498e570c2852e7cc7ccb0d20394d (patch) | |
tree | 1111b40244d430c532bdd288e4d6c399cf31c2c0 /release | |
parent | 2404220e80a99291a6bda2ffcd61b9400b98bf92 (diff) |
Cleanup: tweak logic for skipping modules
Startup is the special case, so match against this instead of 'modules'.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy/utils/__init__.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index d3e0ecc729d..c96b0b88c6b 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -254,12 +254,10 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): if _os.path.isdir(path): _sys_path_ensure(path) - # only add this to sys.modules, don't run - if path_subdir == "modules": - continue - - for mod in modules_from_path(path, loaded_modules): - test_register(mod) + # Only add to 'sys.modules' unless this is 'startup'. + if path_subdir == "startup": + for mod in modules_from_path(path, loaded_modules): + test_register(mod) # load template (if set) if any(_bpy.utils.app_template_paths()): |