File tree 3 files changed +25
-1
lines changed
Filter options
3 files changed +25
-1
lines changed
Original file line number Diff line number Diff line change @@ -3015,3 +3015,22 @@ def is_libssl_fips_mode():
3015
3015
except ImportError :
3016
3016
return False # more of a maybe, unless we add this to the _ssl module.
3017
3017
return get_fips_mode () != 0
3018
+
3019
+
3020
+ def linked_to_musl ():
3021
+ """
3022
+ Test if the Python executable is linked to the musl C library.
3023
+ """
3024
+ if sys .platform != 'linux' :
3025
+ return False
3026
+
3027
+ import subprocess
3028
+ exe = getattr (sys , '_base_executable' , sys .executable )
3029
+ cmd = ['ldd' , exe ]
3030
+ try :
3031
+ stdout = subprocess .check_output (cmd ,
3032
+ text = True ,
3033
+ stderr = subprocess .STDOUT )
3034
+ except (OSError , subprocess .CalledProcessError ):
3035
+ return False
3036
+ return ('musl' in stdout )
Original file line number Diff line number Diff line change @@ -2769,7 +2769,8 @@ def test_fma_infinities(self):
2769
2769
# properly: it doesn't use the right sign when the result is zero.
2770
2770
@unittest .skipIf (
2771
2771
sys .platform .startswith (("freebsd" , "wasi" , "netbsd" , "emscripten" ))
2772
- or (sys .platform == "android" and platform .machine () == "x86_64" ),
2772
+ or (sys .platform == "android" and platform .machine () == "x86_64" )
2773
+ or support .linked_to_musl (), # gh-131032
2773
2774
f"this platform doesn't implement IEE 754-2008 properly" )
2774
2775
def test_fma_zero_result (self ):
2775
2776
nonnegative_finites = [0.0 , 1e-300 , 2.3 , 1e300 ]
Original file line number Diff line number Diff line change @@ -744,6 +744,10 @@ def test_get_signal_name(self):
744
744
self .assertEqual (support .get_signal_name (exitcode ), expected ,
745
745
exitcode )
746
746
747
+ def test_linked_to_musl (self ):
748
+ linked = support .linked_to_musl ()
749
+ self .assertIsInstance (linked , bool )
750
+
747
751
# XXX -follows a list of untested API
748
752
# make_legacy_pyc
749
753
# is_resource_enabled
You can’t perform that action at this time.
0 commit comments