|  | 
| 1 | 1 | import copy | 
| 2 | 2 | import ntpath | 
| 3 |  | -import os | 
| 4 | 3 | import pathlib | 
| 5 | 4 | import posixpath | 
| 6 |  | -import shutil | 
| 7 |  | -import subprocess | 
| 8 |  | -import sys | 
| 9 |  | -import sysconfig | 
| 10 |  | -import tempfile | 
| 11 | 5 | import unittest | 
| 12 | 6 | 
 | 
| 13 | 7 | from test.support import verbose | 
| @@ -870,37 +864,6 @@ def test_PYTHONHOME_in_venv(self): | 
| 870 | 864 |         actual = getpath(ns, expected) | 
| 871 | 865 |         self.assertEqual(expected, actual) | 
| 872 | 866 | 
 | 
| 873 |  | - | 
| 874 |  | -class RealGetPathTests(unittest.TestCase): | 
| 875 |  | -    @unittest.skipUnless( | 
| 876 |  | -        sysconfig.is_python_build(), | 
| 877 |  | -        'Test only available when running from the buildir', | 
| 878 |  | -    ) | 
| 879 |  | -    @unittest.skipUnless( | 
| 880 |  | -        any(sys.platform.startswith(p) for p in ('linux', 'freebsd', 'centos')), | 
| 881 |  | -        'Test only support on Linux-like OS-es (support LD_LIBRARY_PATH)', | 
| 882 |  | -    ) | 
| 883 |  | -    @unittest.skipUnless( | 
| 884 |  | -        sysconfig.get_config_var('LDLIBRARY') != sysconfig.get_config_var('LIBRARY'), | 
| 885 |  | -        'Test only available when using a dynamic libpython', | 
| 886 |  | -    ) | 
| 887 |  | -    def test_builddir_wrong_library_warning(self): | 
| 888 |  | -        library_name = sysconfig.get_config_var('INSTSONAME') | 
| 889 |  | -        with tempfile.TemporaryDirectory() as tmpdir: | 
| 890 |  | -            shutil.copy2( | 
| 891 |  | -                os.path.join(sysconfig.get_config_var('srcdir'), library_name), | 
| 892 |  | -                os.path.join(tmpdir, library_name) | 
| 893 |  | -            ) | 
| 894 |  | -            env = os.environ.copy() | 
| 895 |  | -            env['LD_LIBRARY_PATH'] = tmpdir | 
| 896 |  | -            process = subprocess.run( | 
| 897 |  | -                [sys.executable, '-c', ''], | 
| 898 |  | -                env=env, check=True, capture_output=True, text=True, | 
| 899 |  | -            ) | 
| 900 |  | -        error_msg = 'The runtime library has been loaded from outside the build directory' | 
| 901 |  | -        self.assertTrue(process.stderr.startswith(error_msg), process.stderr) | 
| 902 |  | - | 
| 903 |  | - | 
| 904 | 867 | # ****************************************************************************** | 
| 905 | 868 | 
 | 
| 906 | 869 | DEFAULT_NAMESPACE = dict( | 
|  | 
0 commit comments