Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31342>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to