]> jfr.im git - erebus.git/blobdiff - ctlmod.py
move stuff around
[erebus.git] / ctlmod.py
index d5e6debd09bfe24da6d1d5c0207cdf2adbdc6df2..9a30c7e2c0f54c54f7ae2110bba9eb1a3bc3b5a9 100644 (file)
--- a/ctlmod.py
+++ b/ctlmod.py
@@ -18,7 +18,7 @@ def load(parent, modname):
                if not hasattr(mod, 'modinfo'):
                        return modlib.error('no modinfo')
 
-               if 1 not in mod.modinfo['compatible']:
+               if parent.APIVERSION not in mod.modinfo['compatible']:
                        return modlib.error('API-incompatible')
 
                modules[modname] = mod
@@ -48,7 +48,9 @@ def unload(parent, modname):
                        unload(parent, dependent)
                for dep in dependents[modname]:
                        dependents[dep].remove(modname)
-               return modules[modname].modstop(parent)
+               ret = modules[modname].modstop(parent)
+               del modules[modname]
+               return ret
        else:
                return modlib.error('already unloaded')