File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -426,8 +426,13 @@ fami_iternext(FAMIObject *self)
426426 else {
427427 PyObject * t = PyTuple_New (2 );
428428 if (!t ) { return NULL ; }
429+ #if PY_VERSION_HEX >= 0x030D0000 // Python 3.13+
429430 PyObject * k = PyList_GetItemRef (self -> fam -> keys , index );
430- if (!t ) { return NULL ; }
431+ #else
432+ PyObject * k = PyList_GET_ITEM (self -> fam -> keys , index );
433+ Py_XINCREF (k );
434+ #endif
435+ if (!k ) { return NULL ; }
431436 PyTuple_SET_ITEM (t , 0 , k );
432437 PyTuple_SET_ITEM (t , 1 , PyLong_FromSsize_t (index ));
433438 return t ;
@@ -438,7 +443,12 @@ fami_iternext(FAMIObject *self)
438443 return PyArray_ToScalar (PyArray_GETPTR1 (self -> keys_array , index ), self -> keys_array );
439444 }
440445 else {
446+ #if PY_VERSION_HEX >= 0x030D0000 // Python 3.13+
441447 PyObject * yield = PyList_GetItemRef (self -> fam -> keys , index );
448+ #else
449+ PyObject * yield = PyList_GET_ITEM (self -> fam -> keys , index );
450+ Py_XINCREF (yield );
451+ #endif
442452 if (!yield ) { return NULL ; }
443453 return yield ;
444454 }
You can’t perform that action at this time.
0 commit comments