diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-22 17:43:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-22 17:43:08 +0300 |
commit | c6979aa0f4d2edb1bb24ea9cbdaa1e7477899cb8 (patch) | |
tree | 4916cd69f28a2af6dcfe06b55d46b909821bcaea /release/scripts/modules | |
parent | ad65d6995cd87656e3d9b7dee07adbcea16b564c (diff) |
continue when there are errors on reloading scripts
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index fb0bdd2fa1e..96cd846d4b3 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -65,6 +65,13 @@ def load_scripts(reload_scripts=False): traceback.print_exc() return None + def test_reload(module): + try: + reload(module) + except: + traceback.print_exc() + return None + if reload_scripts: # reload modules that may not be directly included for type_class_name in dir(types): @@ -76,7 +83,7 @@ def load_scripts(reload_scripts=False): for module_name in loaded_modules: print("Reloading:", module_name) - reload(_sys.modules[module_name]) + test_reload(_sys.modules[module_name]) for base_path in utils.script_paths(): for path_subdir in ("ui", "op", "io"): @@ -96,7 +103,7 @@ def load_scripts(reload_scripts=False): if reload_scripts and mod: print("Reloading:", mod) - reload(mod) + test_reload(mod) if DEBUG: print("Time %.4f" % (time.time() - t_main)) |