mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-106718: Treat PyConfig.stdlib_dir as highest-priority setting for stdlib_dir when calculating paths (GH-108730)
This commit is contained in:
parent
821a7ac493
commit
834b7c18d7
3 changed files with 30 additions and 10 deletions
|
@ -818,6 +818,20 @@ class MockGetPathTests(unittest.TestCase):
|
|||
actual = getpath(ns, expected)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
def test_explicitly_set_stdlib_dir(self):
|
||||
"""Test the explicitly set stdlib_dir in the config is respected."""
|
||||
ns = MockPosixNamespace(
|
||||
PREFIX="/usr",
|
||||
argv0="python",
|
||||
ENV_PATH="/usr/bin",
|
||||
)
|
||||
ns["config"]["stdlib_dir"] = "/custom_stdlib_dir"
|
||||
expected = dict(
|
||||
stdlib_dir="/custom_stdlib_dir",
|
||||
)
|
||||
actual = getpath(ns, expected)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
|
||||
# ******************************************************************************
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue