Skip to content

Commit 015608c

Browse files
committed
TEST: Remove final distutils import
1 parent 3fabc03 commit 015608c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

nibabel/tests/test_casting.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,15 @@ def test_best_float():
233233

234234

235235
def test_longdouble_precision_improved():
236-
# Just check that this can only be True on windows, msvc
237-
from numpy.distutils.ccompiler import get_default_compiler
236+
# Just check that this can only be True on Windows
238237

239-
if not (os.name == 'nt' and get_default_compiler() == 'msvc'):
238+
# This previously used distutils.ccompiler.get_default_compiler to check for msvc
239+
# In https://github.com/python/cpython/blob/3467991/Lib/distutils/ccompiler.py#L919-L956
240+
# we see that this was implied by os.name == 'nt', so we can remove this deprecated
241+
# call.
242+
# However, there may be detectable conditions in Windows where we would expect this
243+
# to be False as well.
244+
if os.name != 'nt':
240245
assert not longdouble_precision_improved()
241246

242247

0 commit comments

Comments
 (0)