Skip to content

Commit d70b4f4

Browse files
committed
BF - avoid complex types for SPARC / gcc
Complex types cause bus errors on numpy 1.4.1, 1.6.1 and current (as of 6 March 2012) numpy development versions, on SPARC64, on Debian.
1 parent 0d2ac49 commit d70b4f4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nibabel/tests/test_arraywriters.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def __init__(self, array, out_dtype=None, order='F')
2727
int, or between larger ints and smaller.
2828
"""
2929

30+
from platform import python_compiler, machine
31+
3032
import numpy as np
3133

3234
from ..py3k import BytesIO
@@ -70,8 +72,13 @@ def round_trip(writer, order='F', nan2zero=True, apply_scale=True):
7072
def test_arraywriters():
7173
# Test initialize
7274
# Simple cases
75+
if machine() == 'sparc64' and python_compiler().startswith('GCC'):
76+
# bus errors on at least np 1.4.1 through 1.6.1 for complex
77+
test_types = FLOAT_TYPES + IUINT_TYPES
78+
else:
79+
test_types = NUMERIC_TYPES
7380
for klass in (SlopeInterArrayWriter, SlopeArrayWriter, ArrayWriter):
74-
for type in NUMERIC_TYPES:
81+
for type in test_types:
7582
arr = np.arange(10, dtype=type)
7683
aw = klass(arr)
7784
assert_true(aw.array is arr)

0 commit comments

Comments
 (0)