Skip to content

Commit 8abe0e9

Browse files
committed
Revert "pytest-compatible access to np.float128, np.complex256"
This reverts commit e9a289c.
1 parent e9a289c commit 8abe0e9

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/test_buffers.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010

1111
np = pytest.importorskip("numpy")
1212

13-
14-
def np_dtype_long_double_or_none(name):
15-
# Intentionally not using getattr(np, name, None), to be strict.
16-
if m.std_is_same_double_long_double: # Windows.
17-
return None
18-
return getattr(np, name)
19-
13+
if m.std_is_same_double_long_double: # Windows.
14+
np_float128 = None
15+
np_complex256 = None
16+
else:
17+
np_float128 = np.float128
18+
np_complex256 = np.complex256
2019

2120
CPP_NAME_FORMAT_NP_DTYPE_TABLE = [
2221
item
@@ -33,10 +32,10 @@ def np_dtype_long_double_or_none(name):
3332
("std::uint64_t", "Q", np.uint64),
3433
("float", "f", np.float32),
3534
("double", "d", np.float64),
36-
("long double", "g", np_dtype_long_double_or_none("float128")),
35+
("long double", "g", np_float128),
3736
("std::complex<float>", "Zf", np.complex64),
3837
("std::complex<double>", "Zd", np.complex128),
39-
("std::complex<long double>", "Zg", np_dtype_long_double_or_none("complex256")),
38+
("std::complex<long double>", "Zg", np_complex256),
4039
]
4140
if item[-1] is not None
4241
]

0 commit comments

Comments
 (0)