mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-128469: Revert "warn when libpython was loaded from outside the build directory (#128645)" (#129506)
This commit is contained in:
parent
674befbd7b
commit
31c82c28f9
2 changed files with 0 additions and 50 deletions
|
@ -1,13 +1,7 @@
|
|||
import copy
|
||||
import ntpath
|
||||
import os
|
||||
import pathlib
|
||||
import posixpath
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from test.support import verbose
|
||||
|
@ -870,37 +864,6 @@ class MockGetPathTests(unittest.TestCase):
|
|||
actual = getpath(ns, expected)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
|
||||
class RealGetPathTests(unittest.TestCase):
|
||||
@unittest.skipUnless(
|
||||
sysconfig.is_python_build(),
|
||||
'Test only available when running from the buildir',
|
||||
)
|
||||
@unittest.skipUnless(
|
||||
any(sys.platform.startswith(p) for p in ('linux', 'freebsd', 'centos')),
|
||||
'Test only support on Linux-like OS-es (support LD_LIBRARY_PATH)',
|
||||
)
|
||||
@unittest.skipUnless(
|
||||
sysconfig.get_config_var('LDLIBRARY') != sysconfig.get_config_var('LIBRARY'),
|
||||
'Test only available when using a dynamic libpython',
|
||||
)
|
||||
def test_builddir_wrong_library_warning(self):
|
||||
library_name = sysconfig.get_config_var('INSTSONAME')
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
shutil.copy2(
|
||||
os.path.join(sysconfig.get_config_var('srcdir'), library_name),
|
||||
os.path.join(tmpdir, library_name)
|
||||
)
|
||||
env = os.environ.copy()
|
||||
env['LD_LIBRARY_PATH'] = tmpdir
|
||||
process = subprocess.run(
|
||||
[sys.executable, '-c', ''],
|
||||
env=env, check=True, capture_output=True, text=True,
|
||||
)
|
||||
error_msg = 'The runtime library has been loaded from outside the build directory'
|
||||
self.assertTrue(process.stderr.startswith(error_msg), process.stderr)
|
||||
|
||||
|
||||
# ******************************************************************************
|
||||
|
||||
DEFAULT_NAMESPACE = dict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue