Skip to content

Commit e23826e

Browse files
authored
Merge pull request numpy#27079 from tylerjereddy/treddy_py39_cleanups
MAINT: 3.9/10 cleanups
2 parents 50bd355 + e0b1c55 commit e23826e

File tree

5 files changed

+2
-23
lines changed

5 files changed

+2
-23
lines changed

numpy/_core/src/common/npy_pycompat.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44
#include "numpy/npy_3kcompat.h"
55
#include "pythoncapi-compat/pythoncapi_compat.h"
66

7-
/*
8-
* In Python 3.10a7 (or b1), python started using the identity for the hash
9-
* when a value is NaN. See https://bugs.python.org/issue43475
10-
*/
11-
#if PY_VERSION_HEX > 0x030a00a6
127
#define Npy_HashDouble _Py_HashDouble
13-
#else
14-
static inline Py_hash_t
15-
Npy_HashDouble(PyObject *NPY_UNUSED(identity), double val)
16-
{
17-
return _Py_HashDouble(val);
18-
}
19-
#endif
20-
218

229
#endif /* NUMPY_CORE_SRC_COMMON_NPY_PYCOMPAT_H_ */

numpy/_core/src/multiarray/methods.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2862,7 +2862,6 @@ NPY_NO_EXPORT PyMethodDef array_methods[] = {
28622862
(PyCFunction) array_format,
28632863
METH_VARARGS, NULL},
28642864

2865-
/* for typing; requires python >= 3.9 */
28662865
{"__class_getitem__",
28672866
(PyCFunction)array_class_getitem,
28682867
METH_CLASS | METH_O, NULL},

numpy/_core/tests/test_nditer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,8 +3218,6 @@ def test_warn_noclose():
32183218
assert len(sup.log) == 1
32193219

32203220

3221-
@pytest.mark.skipif(sys.version_info[:2] == (3, 9) and sys.platform == "win32",
3222-
reason="Errors with Python 3.9 on Windows")
32233221
@pytest.mark.parametrize(["in_dtype", "buf_dtype"],
32243222
[("i", "O"), ("O", "i"), # most simple cases
32253223
("i,O", "O,O"), # structured partially only copying O

numpy/_core/tests/test_umath.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,10 +2807,6 @@ def test_reduction(self):
28072807
def test_bitwise_count(self, input_dtype_obj, bitsize):
28082808
input_dtype = input_dtype_obj.type
28092809

2810-
# bitwise_count is only in-built in 3.10+
2811-
if sys.version_info < (3, 10) and input_dtype == np.object_:
2812-
pytest.skip("Required Python >=3.10")
2813-
28142810
for i in range(1, bitsize):
28152811
num = 2**i - 1
28162812
msg = f"bitwise_count for {num}"

numpy/testing/tests/test_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,8 +1923,7 @@ def test_xy_rename(assert_func):
19231923
assert_func(1, y=1)
19241924

19251925
type_message = '...got multiple values for argument'
1926-
# explicit linebreak to support Python 3.9
1927-
with pytest.warns(DeprecationWarning, match=dep_message), \
1928-
pytest.raises(TypeError, match=type_message):
1926+
with (pytest.warns(DeprecationWarning, match=dep_message),
1927+
pytest.raises(TypeError, match=type_message)):
19291928
assert_func(1, x=1)
19301929
assert_func(1, 2, y=2)

0 commit comments

Comments
 (0)