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 os .path
2+ import subprocess
23import sys
34import test .support
45import unittest
@@ -78,9 +79,28 @@ def test_shell_injection(self):
7879@unittest .skipUnless (sys .platform .startswith ('linux' ),
7980 'Test only valid for Linux' )
8081class FindLibraryLinux (unittest .TestCase ):
82+ @classmethod
83+ def setUpClass (cls ):
84+ try :
85+ p = subprocess .run (['ld' , '--version' ],
86+ stdout = subprocess .PIPE ,
87+ stderr = subprocess .DEVNULL ,
88+ text = True )
89+ except OSError :
90+ pass
91+ else :
92+ if p .stdout .startswith ('mold ' ):
93+ # The mold linker is known to be incompatible with
94+ # ctypes.util.find_library. The function is
95+ # documented as "Try to find a library..."
96+ # and formally soft-deprecated in 3.15+. We
97+ # we skip the test rather than try to fix it
98+ # (which would risk breaking other unsupported
99+ # platforms).
100+ raise unittest .SkipTest ('Fails when ld is mold' )
101+
81102 @thread_unsafe ('uses setenv' )
82103 def test_find_on_libpath (self ):
83- import subprocess
84104 import tempfile
85105
86106 try :
You can’t perform that action at this time.
0 commit comments