This is still broken, IMHO. Either we should rename test.bisect or we should remove all of the 'if __name__ == "__main__"' part of the test scripts. You can't run the tests reliably as scripts anymore. Doing so puts Lib/test into sys.path. Then, anything that imports 'bisect' (e.g. the random module) will get test.bisect and not the real bisect module.
I tried making it so that test.bisect could not be imported as bisect but I can't think of a way. E.g. adding to test/__init__.py
import test._bisect as bisect
sys.modules['test.bisect'] = bisect
does not work. I don't understand the import system good enough to think of a solution. |