Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-91985: Ensure in-tree builds override platstdlib_dir in every path calculation #93641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 16, 2022
Merged
Prev Previous commit
Next Next commit
remove test
  • Loading branch information
neonene committed Jun 13, 2022
commit 5cb5e2bce2c908df1461f7ea78fca2b69a3a4b0a
42 changes: 0 additions & 42 deletions 42 Lib/test/test_getpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,48 +239,6 @@ def test_buildtree_pythonhome_win32(self):
actual = getpath(ns, expected)
self.assertEqual(expected, actual)

def test_run_in_tree_build_win32(self):
"Test _is_python_build fields with invalid cases.(gh-91985)"
def read_pathconfig(config, attr):
if _Py_path_config[attr] >= 0 and config[attr] <= 0:
config[attr] = _Py_path_config[attr]

def update_pathconfig(config, attr):
if config[attr] > 0:
_Py_path_config[attr] = config[attr]

for flags in [(0,-1), (-1, 0), (-1,-1), (-10, 0), [-10, 5], [5,-10]]:
_Py_path_config = dict(
_is_python_build=flags[0],
)
ns = MockNTNamespace(
argv0=r"C:\CPython\PCbuild\amd64\python.exe",
)
ns.add_known_file(r"C:\CPython\PCbuild\amd64\pybuilddir.txt", [""])
ns['config'].update(
home=r"C:\CPython", # turn on 'home_was_set'
_is_python_build=flags[1],
)
# _PyConfig_InitPathConfig emulation
read_pathconfig(ns['config'], '_is_python_build')
if isinstance(flags, tuple):
expected = dict(
_is_python_build=ns['config']['_is_python_build'],
build_prefix=None,
platstdlib_dir=r"C:\CPython\DLLs",
)
else:
flags = (1, 1)
expected = dict(
_is_python_build=flags[1],
build_prefix=r"C:\CPython",
platstdlib_dir=r"C:\CPython\PCbuild\amd64",
)
actual = getpath(ns, expected)
self.assertEqual(actual, expected)
update_pathconfig(actual, '_is_python_build')
self.assertEqual(_Py_path_config['_is_python_build'], flags[0])

def test_normal_posix(self):
"Test a 'standard' install layout on *nix"
ns = MockPosixNamespace(
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.