Skip to content

Commit 768aaf6

Browse files
authored
bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)
Fix test_sys.test_stdlib_dir() when Python is built outside the source tree: compare normalized paths.
1 parent ff8859d commit 768aaf6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/test/test_sys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,8 @@ def test_stdlib_dir(self):
10011001
if marker and not os.path.exists(marker):
10021002
marker = None
10031003
expected = os.path.dirname(marker) if marker else None
1004-
actual = sys._stdlib_dir
1005-
self.assertEqual(actual, expected)
1004+
self.assertEqual(os.path.normpath(sys._stdlib_dir),
1005+
os.path.normpath(expected))
10061006

10071007

10081008
@test.support.cpython_only
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix test_sys.test_stdlib_dir() when Python is built outside the source tree:
2+
compare normalized paths. Patch by Victor Stinner.

0 commit comments

Comments
 (0)