From 9b33bf50dae997b01dfe24878a58100da61b89e1 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 23 May 2017 16:25:25 -0700 Subject: Improves test_underpth_nosite_file to reveal why it fails. (#1763) * Improves test_underpth_nosite_file to reveal why it fails. * Enable building with Windows 10 SDK. * Fix WinSDK detection * Fix initialization on Windows when a ._pth file exists. * Fix tabs * Adds comment about Py_GetPath call. --- Lib/test/test_site.py | 16 ++++++++++------ PCbuild/python.props | 15 +++++++++++++++ Python/pylifecycle.c | 7 ++++++- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 0924f01..1501622 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -547,12 +547,16 @@ class _pthFileTests(unittest.TestCase): env = os.environ.copy() env['PYTHONPATH'] = 'from-env' env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH')) - rc = subprocess.call([exe_file, '-c', - 'import sys; sys.exit(sys.flags.no_site and ' - 'len(sys.path) > 200 and ' - 'sys.path == %r)' % sys_path, - ], env=env) - self.assertTrue(rc, "sys.path is incorrect") + output = subprocess.check_output([exe_file, '-c', + 'import sys; print("\\n".join(sys.path) if sys.flags.no_site else "")' + ], env=env, encoding='ansi') + actual_sys_path = output.rstrip().split('\n') + self.assert_(actual_sys_path, "sys.flags.no_site was False") + self.assertEqual( + actual_sys_path, + sys_path, + "sys.path is incorrect" + ) def test_underpth_file(self): libpath = os.path.dirname(os.path.dirname(encodings.__file__)) diff --git a/PCbuild/python.props b/PCbuild/python.props index d6bfd08..563487e 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -63,6 +63,21 @@ $(BuildPath)python$(PyDebugExt).exe + + + 10.0.15063.0 + 10.0.15063.0 + 10.0.10586.0 + 10.0.10586.0 + 10.0.10240.0 + 10.0.10240.0 + +