Skip to content

Conversation

@wr-web
Copy link
Contributor

@wr-web wr-web commented Jan 20, 2026

Remove incorrect Py_DECREF call for marker.

Related Code

#else
if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
Py_DECREF(marker);

PyList_SetItem Source Code

PyList_SetItem Document

PyList_SetItem Python Forum Discussion

Therefore, whether the function succeeds or fails, it will steal a reference count of the third argument. It must not call Py_DECREF in case of failure.

How was this PR tested?

  • Tests have Added for the changes
  • Production environment verified

Remove unnecessary Py_DECREF call for marker.
Copy link
Contributor

@Leomrlin Leomrlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cbqiao cbqiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cbqiao cbqiao merged commit 019da95 into apache:master Jan 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants