2017-07-04 13:22 GMT+02:00 Nick Coghlan <ncogh...@gmail.com>:
> That means if test.bisect is shadowing the top level bisect module
> when backported, it suggests that the test.regrtest directory is
> ending up on sys.path for the affected test run (e.g. because the
> tests were run as "python Lib/test/regrtest.py" rather than via the -m
> switch).

I don't think that Lib/test/ is in sys.path. It's more subtle than
test. When you run "./python -m test test_bisect",
Lib/test/regrtest.py imports "test.test_bisect", and so test_bisect is
imported with __package__=['test'].

With test_bisect.__package__=['test'], "import bisect" in
Lib/test/test_bisect.py imports Lib/test/bisect.py.

The question is more when Lib/multiprocessing/heap.py got
Lib/test/bisect.py instead of Lib/bisect.py. I didn't dig into this
issue. The Python 2 import machinery blows my mind :-)

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to