diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-10 08:53:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 08:53:09 (GMT) |
commit | 8510f430781118d9b603c3a2f06945d6ebc5fe42 (patch) | |
tree | 511cb42b478dd031ff36297a5e0c78b27a4e77a2 /Lib/test | |
parent | 700cb587303461d5a96456c56902cfdd8ad50e2d (diff) | |
download | cpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.zip cpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.tar.gz cpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.tar.bz2 |
bpo-1294959: Add sys.platlibdir attribute (GH-18381)
Add --with-platlibdir option to the configure script: name of the
platform-specific library directory, stored in the new sys.platlitdir
attribute. It is used to build the path of platform-specific dynamic
libraries and the path of the standard library.
It is equal to "lib" on most platforms. On Fedora and SuSE, it is
equal to "lib64" on 64-bit systems.
Co-Authored-By: Jan Matějek <jmatejek@suse.com>
Co-Authored-By: Matěj Cepl <mcepl@cepl.eu>
Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_embed.py | 8 | ||||
-rw-r--r-- | Lib/test/test_site.py | 11 |
2 files changed, 13 insertions, 6 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 46ed113..444097b 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1068,11 +1068,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): else: ver = sys.version_info return [ - os.path.join(prefix, 'lib', + os.path.join(prefix, sys.platlibdir, f'python{ver.major}{ver.minor}.zip'), - os.path.join(prefix, 'lib', + os.path.join(prefix, sys.platlibdir, f'python{ver.major}.{ver.minor}'), - os.path.join(exec_prefix, 'lib', + os.path.join(exec_prefix, sys.platlibdir, f'python{ver.major}.{ver.minor}', 'lib-dynload'), ] @@ -1183,7 +1183,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): if not MS_WINDOWS: lib_dynload = os.path.join(pyvenv_home, - 'lib', + sys.platlibdir, f'python{ver.major}.{ver.minor}', 'lib-dynload') os.makedirs(lib_dynload) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 41c4229..6a95e33 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -266,11 +266,18 @@ class HelperFunctionsTests(unittest.TestCase): dirs = site.getsitepackages() if os.sep == '/': # OS X, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) + if sys.platlibdir != "lib": + self.assertEqual(len(dirs), 2) + wanted = os.path.join('xoxo', sys.platlibdir, + 'python%d.%d' % sys.version_info[:2], + 'site-packages') + self.assertEqual(dirs[0], wanted) + else: + self.assertEqual(len(dirs), 1) wanted = os.path.join('xoxo', 'lib', 'python%d.%d' % sys.version_info[:2], 'site-packages') - self.assertEqual(dirs[0], wanted) + self.assertEqual(dirs[-1], wanted) else: # other platforms self.assertEqual(len(dirs), 2) |