This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nascheme
Recipients nascheme, vstinner
Date 2018-07-16.19:41:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531770118.1.0.56676864532.issue31342@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-07-16 19:41:58naschemesetrecipients: + nascheme, vstinner
2018-07-16 19:41:58naschemesetmessageid: <1531770118.1.0.56676864532.issue31342@psf.upfronthosting.co.za>
2018-07-16 19:41:58naschemelinkissue31342 messages
2018-07-16 19:41:58naschemecreate