Commit 7ada1ede authored by Luke Campagnola's avatar Luke Campagnola
Browse files

reloadAll now raises exception if any modules fail to reload

parent 3fc741ab
......@@ -34,6 +34,7 @@ def reloadAll(prefix=None, debug=False):
- Skips reload if the file has not been updated (if .pyc is newer than .py)
- if prefix is None, checks all loaded modules
"""
failed = []
for modName, mod in list(sys.modules.items()): ## don't use iteritems; size may change during reload
if not inspect.ismodule(mod):
continue
......@@ -58,7 +59,10 @@ def reloadAll(prefix=None, debug=False):
reload(mod, debug=debug)
except:
printExc("Error while reloading module %s, skipping\n" % mod)
failed.append(mod.__name__)
if len(failed) > 0:
raise Exception("Some modules failed to reload: %s" % ', '.join(failed))
def reload(module, debug=False, lists=False, dicts=False):
"""Replacement for the builtin reload function:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment