From be1e61b09352498e570c2852e7cc7ccb0d20394d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 13 Jun 2019 10:03:06 +1000 Subject: Cleanup: tweak logic for skipping modules Startup is the special case, so match against this instead of 'modules'. --- release/scripts/modules/bpy/utils/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'release/scripts/modules/bpy') 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()): -- cgit v1.2.3