Skip to content

Usage of PyList_GetItemRef not guarded by API version check? #7269

@timfel

Description

@timfel

Should we be using __Pyx_PyList_GetItemRef below?

*ppos = pos + 1;
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
next_item = PyList_GetItemRef(iter_obj, pos);
if (unlikely(!next_item)) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS

My reasoning is that CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS is defined to 1 for both PyPy and GraalPy by default, so we run into this even though we are not on 3.13, yet (where PyList_GetItemRef was added).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions