From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:31:08 +0000 (+0200) Subject: [3.11] gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076) X-Git-Tag: v3.11.10~25^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38bcbb22f9f0e86b66feb9381810a09e7488dc1f;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076) gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076) (cherry picked from commit 52f5b7f9e05fc4a25e385c046e0b091641674556) Co-authored-by: AN Long --- diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index a60f4cd3111e..9563282e6d9b 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -253,7 +253,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):