diff -r c91e6a74a4bc -r 349fa0e3e253 src/python/importer.py --- a/src/python/importer.py Thu May 02 12:19:02 2013 +0200 +++ b/src/python/importer.py Thu May 02 12:19:11 2013 +0200 @@ -54,8 +54,7 @@ import imp import os import sys - mod = imp.new_module(fullname) - sys.modules[fullname] = mod + mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) try: mod.__loader__ = self @@ -68,6 +67,9 @@ if os.path.basename(srcfile) == '__init__.py': mod.__path__ = fullname.split('.') + mod.__package__ = fullname + else: + mod.__package__ = fullname.rpartition('.')[0] mod.__file__ = srcfile exec code in mod.__dict__