Skip to content

change to new cpython api call #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charm4py/charmlib/charmlib_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from libc.stdint cimport uintptr_t
from cpython.version cimport PY_MAJOR_VERSION
from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_ANY_CONTIGUOUS, PyBUF_SIMPLE
from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM
from cpython.int cimport PyInt_FromSsize_t
from cpython.long cimport PyLong_FromSsize_t
from cpython.ref cimport Py_INCREF
from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free
from cython.operator cimport dereference
Expand Down Expand Up @@ -280,12 +280,12 @@ cdef inline object array_index_to_tuple(int ndims, int *arrayIndex):
arrIndex = PyTuple_New(ndims)
if ndims <= 3:
for i in range(ndims):
d = PyInt_FromSsize_t(arrayIndex[i])
d = PyLong_FromSsize_t(arrayIndex[i])
Py_INCREF(d)
PyTuple_SET_ITEM(arrIndex, i, d)
else:
for i in range(ndims):
d = PyInt_FromSsize_t((<short*>arrayIndex)[i])
d = PyLong_FromSsize_t((<short*>arrayIndex)[i])
Py_INCREF(d)
PyTuple_SET_ITEM(arrIndex, i, d)
return arrIndex
Expand Down
Loading