1From 37d058e841ba3bd89b5746cc5381afb014b11581 Mon Sep 17 00:00:00 2001
2From: Wentao Zhang <wentao.zhang@windriver.com>
3Date: Mon, 20 Mar 2023 13:39:52 +0800
4Subject: [PATCH] Update test_sysconfig for posix_user purelib
5
6Steps to trigger the failed test:
7Edit local.conf to add something as follows:
8    BASELIB = "lib64"
9    IMAGE_INSTALL:append = " python3-tests".
10bitbake core-image-sato
11runqemu qemux86-64 nographic slirp
12Reproducer:
13    $python3 -m test test_sysconfig
14
15Update test_sysconfig.test_user_similar() for the posix_user scheme:
16"purelib" doesn't use sys.platlibdir.
17
18Upstream-Status: Inappropriate [oe-core specific]
19Signed-off-by: Wentao Zhang <wentao.zhang@windriver.com>
20
21---
22 Lib/test/test_sysconfig.py | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
26index b6dbf3d..5672590 100644
27--- a/Lib/test/test_sysconfig.py
28+++ b/Lib/test/test_sysconfig.py
29@@ -372,7 +372,7 @@ class TestSysConfig(unittest.TestCase):
30                 expected = os.path.normpath(global_path.replace(base, user, 1))
31                 # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
32                 # whereas posix_prefix does.
33-                if name == 'platlib':
34+                if name == 'platlib' or name == 'purelib':
35                     # Replace "/lib64/python3.11/site-packages" suffix
36                     # with "/lib/python3.11/site-packages".
37                     py_version_short = sysconfig.get_python_version()
38