File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import unittest
22import unittest .mock
33import os .path
4+ import subprocess
45import sys
56import test .support
67from test .support import os_helper
@@ -75,8 +76,27 @@ def test_shell_injection(self):
7576@unittest .skipUnless (sys .platform .startswith ('linux' ),
7677 'Test only valid for Linux' )
7778class FindLibraryLinux (unittest .TestCase ):
79+ @classmethod
80+ def setUpClass (cls ):
81+ try :
82+ p = subprocess .run (['ld' , '--version' ],
83+ stdout = subprocess .PIPE ,
84+ stderr = subprocess .DEVNULL ,
85+ text = True )
86+ except OSError :
87+ pass
88+ else :
89+ if p .stdout .startswith ('mold ' ):
90+ # The mold linker is known to be incompatible with
91+ # ctypes.util.find_library. The function is
92+ # documented as "Try to find a library..."
93+ # and formally soft-deprecated in 3.15+. We
94+ # we skip the test rather than try to fix it
95+ # (which would risk breaking other unsupported
96+ # platforms).
97+ raise unittest .SkipTest ('Fails when ld is mold' )
98+
7899 def test_find_on_libpath (self ):
79- import subprocess
80100 import tempfile
81101
82102 try :
You can’t perform that action at this time.
0 commit comments