forked from bartvdbraak/blender
continue when there are errors on reloading scripts
This commit is contained in:
parent
ad65d6995c
commit
c6979aa0f4
@ -65,6 +65,13 @@ def load_scripts(reload_scripts=False):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def test_reload(module):
|
||||||
|
try:
|
||||||
|
reload(module)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
return None
|
||||||
|
|
||||||
if reload_scripts:
|
if reload_scripts:
|
||||||
# reload modules that may not be directly included
|
# reload modules that may not be directly included
|
||||||
for type_class_name in dir(types):
|
for type_class_name in dir(types):
|
||||||
@ -76,7 +83,7 @@ def load_scripts(reload_scripts=False):
|
|||||||
|
|
||||||
for module_name in loaded_modules:
|
for module_name in loaded_modules:
|
||||||
print("Reloading:", module_name)
|
print("Reloading:", module_name)
|
||||||
reload(_sys.modules[module_name])
|
test_reload(_sys.modules[module_name])
|
||||||
|
|
||||||
for base_path in utils.script_paths():
|
for base_path in utils.script_paths():
|
||||||
for path_subdir in ("ui", "op", "io"):
|
for path_subdir in ("ui", "op", "io"):
|
||||||
@ -96,7 +103,7 @@ def load_scripts(reload_scripts=False):
|
|||||||
|
|
||||||
if reload_scripts and mod:
|
if reload_scripts and mod:
|
||||||
print("Reloading:", mod)
|
print("Reloading:", mod)
|
||||||
reload(mod)
|
test_reload(mod)
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print("Time %.4f" % (time.time() - t_main))
|
print("Time %.4f" % (time.time() - t_main))
|
||||||
|
Loading…
Reference in New Issue
Block a user