Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Lib/test/test_ctypes/test_find.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os.path
import subprocess
import sys
import test.support
import unittest
Expand Down Expand Up @@ -78,9 +79,28 @@ def test_shell_injection(self):
@unittest.skipUnless(sys.platform.startswith('linux'),
'Test only valid for Linux')
class FindLibraryLinux(unittest.TestCase):
@classmethod
def setUpClass(cls):
try:
p = subprocess.run(['ld', '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True)
except OSError:
pass
else:
if p.stdout.startswith('mold '):
# The mold linker is known to be incompatible with
# ctypes.util.find_library. The function is
# documented as "Try to find a library..."
# and formally soft-deprecated in 3.15+. We
# we skip the test rather than try to fix it
# (which would risk breaking other unsupported
# platforms).
raise unittest.SkipTest('Fails when ld is mold')

@thread_unsafe('uses setenv')
def test_find_on_libpath(self):
import subprocess
import tempfile

try:
Expand Down
Loading