]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 2 Apr 2024 13:29:32 +0000 (15:29 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Apr 2024 13:29:32 +0000 (13:29 +0000)
gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)
(cherry picked from commit 52f5b7f9e05fc4a25e385c046e0b091641674556)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Lib/test/test_venv.py

index 7540be2c10b86e9e33ee865ffbda1c778eec83f9..2f4417621e5ab808f66a5f05542a1659eab8d999 100644 (file)
@@ -252,7 +252,8 @@ class BasicTest(BaseTest):
             ('base_exec_prefix', sys.base_exec_prefix)):
             cmd[2] = 'import sys; print(sys.%s)' % prefix
             out, err = check_output(cmd)
-            self.assertEqual(out.strip(), expected.encode(), prefix)
+            self.assertEqual(pathlib.Path(out.strip().decode()),
+                             pathlib.Path(expected), prefix)
 
     @requireVenvCreate
     def test_sysconfig(self):