def notify(self, event):
"""Notify all subscribers with the given event object."""
- for cb in self.subscribers:
+ for cb in list(self.subscribers):
try:
cb(event)
except: pass
sysinfo["hostname"] = simpleattr(func = socket.gethostname)
sysinfo["platform"] = valueattr(init = sys.platform)
-sysctl = simplefunc(exit=lambda status=0: os._exit(status))
+def reload(modname):
+ mod = sys.modules.get(modname)
+ if mod is None:
+ raise ValueError(modname)
+ import importlib
+ importlib.reload(mod)
+
+sysctl = simplefunc(exit=lambda status=0: os._exit(status),
+ reload=reload)