diff -r 4b64a049f451 Lib/test/test_site.py --- a/Lib/test/test_site.py Fri Aug 19 12:00:13 2016 +0300 +++ b/Lib/test/test_site.py Sat Aug 20 08:06:05 2016 +1000 @@ -444,8 +444,13 @@ def test_startup_imports(self): # This tests checks which modules are loaded by Python when it # initially starts upon startup. - popen = subprocess.Popen([sys.executable, '-I', '-v', '-c', - 'import sys; print(set(sys.modules))'], + popen = subprocess.Popen([sys.executable, '-I', '-S', '-v', '-c', + ('import sys, site;' + # Prevent .pth files from disrupting the test + # http://bugs.python.org/issue27807 + 'site.addpackage=lambda *a: None;' + 'site.main();' + 'print(set(sys.modules))')], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = popen.communicate()