#!/usr/bin/env python
import os
+import sys
import os.path
import shutil
shutil.rmtree(os.path.join(dir, f))
else:
raise err
+
+def load_module(modname):
+ """Return the module `modname` (full name) if loaded, or try to import it.
+ Returns the module or raises `ImportError`."""
+ if not sys.modules.has_key(modname):
+ __import__(modname)
+ return sys.modules[modname]