Skip to content

Commit c409b13

Browse files
committed
updated numpy version, removed some usage of PyList_GET_ITEM
1 parent 1516618 commit c409b13

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

requirements-build-3_13.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
numpy==2.2.5
1+
numpy==2.3.1
22
setuptools==80.*

requirements-dev-3_13.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
numpy==2.2.5
1+
numpy==2.3.1
22
pytest==8.3.3
33
invoke==2.2.0
44
hypothesis==6.131.16

src/_arraykit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static struct PyModuleDef arraykit_module = {
7272
.m_methods = arraykit_methods,
7373
};
7474

75-
PyObject *
75+
PyObject*
7676
PyInit__arraykit(void)
7777
{
7878
import_array();
@@ -134,6 +134,9 @@ PyInit__arraykit(void)
134134
Py_XDECREF(m);
135135
return NULL;
136136
}
137+
#ifdef Py_GIL_DISABLED
138+
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
139+
#endif
137140
return m;
138141
}
139142

src/auto_map.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,8 @@ fami_iternext(FAMIObject *self)
426426
else {
427427
PyObject* t = PyTuple_New(2);
428428
if (!t) { return NULL; }
429-
PyObject* k = PyList_GET_ITEM(self->fam->keys, index);
430-
Py_INCREF(k);
429+
PyObject* k = PyList_GetItemRef(self->fam->keys, index);
430+
if (!t) { return NULL; }
431431
PyTuple_SET_ITEM(t, 0, k);
432432
PyTuple_SET_ITEM(t, 1, PyLong_FromSsize_t(index));
433433
return t;
@@ -438,8 +438,8 @@ fami_iternext(FAMIObject *self)
438438
return PyArray_ToScalar(PyArray_GETPTR1(self->keys_array, index), self->keys_array);
439439
}
440440
else {
441-
PyObject* yield = PyList_GET_ITEM(self->fam->keys, index);
442-
Py_INCREF(yield);
441+
PyObject* yield = PyList_GetItemRef(self->fam->keys, index);
442+
if (!yield) { return NULL; }
443443
return yield;
444444
}
445445
}
@@ -1302,11 +1302,11 @@ lookup(FAMObject *self, PyObject *key) {
13021302
return self->table[table_pos].keys_pos;
13031303
}
13041304

1305-
// Insert a key_pos, hash pair into the table. Assumes table already has appropriate size. When inserting a new itme, `hash` is -1, forcing a fresh hash to be computed here. Return 0 on success, -1 on error.
1305+
// Insert a key_pos, hash pair into the table. Assumes table already has appropriate size. When inserting a new item, `hash` is -1, forcing a fresh hash to be computed here. Return 0 on success, -1 on error.
13061306
static int
13071307
insert_obj(
13081308
FAMObject *self,
1309-
PyObject *key,
1309+
PyObject *key, // NOTE: a borrowed reference
13101310
Py_ssize_t keys_pos,
13111311
Py_hash_t hash)
13121312
{

0 commit comments

Comments
 (0)