From 50dd737089d46adc1bd5c0e7f97d137c10cb1166 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Sat, 23 Mar 2024 13:41:02 -0400 Subject: [PATCH] `casting.py`: Remove `uname` check for WSL1 --- nibabel/casting.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nibabel/casting.py b/nibabel/casting.py index ec8608957..77da57e40 100644 --- a/nibabel/casting.py +++ b/nibabel/casting.py @@ -6,7 +6,7 @@ from __future__ import annotations import warnings -from platform import machine, processor, uname +from platform import machine, processor import numpy as np @@ -275,12 +275,10 @@ def type_info(np_type): width=width, ) # Mitigate warning from WSL1 when checking `np.longdouble` (#1309) - # src for '-Microsoft': https://github.com/microsoft/WSL/issues/4555#issuecomment-536862561 with warnings.catch_warnings(): - if uname().release.endswith('-Microsoft'): - warnings.filterwarnings( - action='ignore', category=UserWarning, message='Signature.*numpy.longdouble' - ) + warnings.filterwarnings( + action='ignore', category=UserWarning, message='Signature.*numpy.longdouble' + ) info = np.finfo(dt) # Trust the standard IEEE types