Skip to content

Commit 3050987

Browse files
authored
bpo-30843: regrtest fixes sys.path, restore test.bisect (#2567)
* Rename again Lib/test/bisectcmd.py to Lib/test/bisect.py * regrtest now removes '' and Lib/test/ from sys.path * Use absolute import in test_bisect
1 parent d0ae4be commit 3050987

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎Lib/test/regrtest.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
464464
# to locate tests
465465
sys.path.insert(0, testdir)
466466

467+
# Make sure that '' and Lib/test/ are not in sys.path
468+
regrtest_dir = os.path.abspath(os.path.dirname(__file__))
469+
for path in ('', regrtest_dir):
470+
try:
471+
sys.path.remove(path)
472+
except ValueError:
473+
pass
474+
467475
if slaveargs is not None:
468476
args, kwargs = json.loads(slaveargs)
469477
if kwargs['huntrleaks']:

‎Lib/test/test_bisect.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import
12
import sys
23
import unittest
34
from test import test_support

0 commit comments

Comments
 (0)