moduleLoader an artifact of the documentation tells people what it does/is/is for. We don"t need to replicate the bad thing.
#3387
same way each time except ZeroDivisionError: pass " Traceback (most recent call last): File "<string>", line 6, in <module> File "/home/exarkun/Projects/Twisted/trunk/twisted/python/modules.py", line 380, in load return self.pathEntry.pythonPath.moduleLoader(self.name) File "/home/exarkun/Projects/Twisted/trunk/twisted/python/modules.py", line 618, in moduleLoader return self._moduleLoader(modname) File "/home/exarkun/Projects/Twisted/trunk/twisted/python/reflect.py", line 455, in namedAny topLevelPackage = _importAndCheckStack(trialname) File "/home/exarkun/Projects/Twisted/trunk/twisted/python/reflect.py", line 391, in _importAndCheckStack return __import__(importName) File "foo/broken.py", line 1, in <module> import foo.working File "foo/working.py", line 3, in <module> registerAdapter(int, int, IReactorTime) File "/home/exarkun/Projects/Twisted/trunk/twisted/python/components.py", line 90, in registerAdapter raise ValueError("an adapter (%s) was already registered." % (factory, )) ValueError: an adapter (<type "int">) was already registered. exarkun@boson:~$ the exarkun@boson:~$ mkdir foo exarkun@boson:~$ touch foo/__init__.py exarkun@boson:~$ cat > foo/working.py from twisted.internet.interfaces import IReactorTime from twisted.python.components import registerAdapter registerAdapter(int, int, IReactorTime) exarkun@boson:~$ cat > foo/broken.py import foo.working 1/0 exarkun@boson:~$ python -c "from twisted.python.modules import getModule from twisted.python import components # make sure the global adapter registry survives from twisted.internet import interfaces # make sure IReactorTime survives for i in range(3): try: getModule("foo.broken").load() # this should fail have inconsistent modules in