diff -r 3a6746dfc57f -r f13799fbcfea cubicweb/__init__.py --- a/cubicweb/__init__.py Fri Jan 20 18:17:04 2017 +0100 +++ b/cubicweb/__init__.py Mon Jan 23 15:35:19 2017 +0100 @@ -26,6 +26,7 @@ import pickle import pkgutil import sys +import types import warnings import zlib @@ -294,7 +295,9 @@ sys.meta_path.append(self) def find_module(self, fullname, path=None): - if fullname.startswith('cubes.'): + if fullname == 'cubes': + return self + elif fullname.startswith('cubes.'): modname = 'cubicweb_' + fullname.split('.', 1)[1] try: modinfo = imp.find_module(modname) @@ -302,3 +305,9 @@ return None else: return pkgutil.ImpLoader(fullname, *modinfo) + + def load_module(self, fullname): + if fullname != 'cubes': + raise ImportError('No module named {0}'.format(fullname)) + mod = sys.modules[fullname] = types.ModuleType(fullname, doc='CubicWeb cubes') + return mod