@@ -28,7 +28,7 @@ def get_glibc_version():
28
28
29
29
30
30
glibcver = get_glibc_version ()
31
- glibc_older_than_2_17 = (glibcver != '0.0' and glibcver < '2.17' )
31
+ glibc_older_than = lambda x : (glibcver != '0.0' and glibcver < x )
32
32
33
33
def on_powerpc ():
34
34
""" True if we are running on a Power PC platform."""
@@ -1012,10 +1012,9 @@ def test_exp_values(self):
1012
1012
yf = np .array (y , dtype = dt )
1013
1013
assert_equal (np .exp (yf ), xf )
1014
1014
1015
- # Older version of glibc may not raise the correct FP exceptions
1016
1015
# See: https://github.com/numpy/numpy/issues/19192
1017
1016
@pytest .mark .xfail (
1018
- glibc_older_than_2_17 ,
1017
+ glibc_older_than ( "2.17" ) ,
1019
1018
reason = "Older glibc versions may not raise appropriate FP exceptions"
1020
1019
)
1021
1020
def test_exp_exceptions (self ):
@@ -1398,7 +1397,7 @@ def test_sincos_float32(self):
1398
1397
M = np .int_ (N / 20 )
1399
1398
index = np .random .randint (low = 0 , high = N , size = M )
1400
1399
x_f32 = np .float32 (np .random .uniform (low = - 100. ,high = 100. ,size = N ))
1401
- if not glibc_older_than_2_17 :
1400
+ if not glibc_older_than ( "2.17" ) :
1402
1401
# test coverage for elements > 117435.992f for which glibc is used
1403
1402
# this is known to be problematic on old glibc, so skip it there
1404
1403
x_f32 [index ] = np .float32 (10E+10 * np .random .rand (M ))
@@ -3434,7 +3433,7 @@ def check(x, rtol):
3434
3433
x_series = np .logspace (- 20 , - 3.001 , 200 )
3435
3434
x_basic = np .logspace (- 2.999 , 0 , 10 , endpoint = False )
3436
3435
3437
- if glibc_older_than_2_17 and dtype is np .longcomplex :
3436
+ if glibc_older_than ( "2.19" ) and dtype is np .longcomplex :
3438
3437
if (platform .machine () == 'aarch64' and bad_arcsinh ()):
3439
3438
pytest .skip ("Trig functions of np.longcomplex values known "
3440
3439
"to be inaccurate on aarch64 for some compilation "
0 commit comments