Skip to content

Commit 0fb8920

Browse files
committed
BF: reintroduce try/except guarding around initial np.isnan
See failures in https://travis-ci.org/nipy/nibabel/jobs/437900384
1 parent 1996ead commit 0fb8920

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nibabel/cmdline/diff.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ def are_values_different(*values):
5656

5757
# to not recompute over again
5858
if isinstance(value0, np.ndarray):
59-
value0_nans = np.isnan(value0)
60-
if not np.any(value0_nans):
61-
value0_nans = None
59+
try:
60+
value0_nans = np.isnan(value0)
61+
if not np.any(value0_nans):
62+
value0_nans = None
63+
except TypeError as exc:
64+
if "not supported" in str(exc):
65+
value0_nans = None
66+
else:
67+
raise
6268

6369
for value in values[1:]:
6470
if type(value0) != type(value): # if types are different, then we consider them different

0 commit comments

Comments
 (0)