Skip to content
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

Remove decrement of reference when using Py_None #1161 #1162

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

siscia
Copy link
Contributor

@siscia siscia commented Oct 3, 2022

Addressing #1161

If the representation of a signature requires the use of Py_None we should not decrement the reference count of the special Py_None object.

I tried adding a unit test to verify this new behavior, unfortunately, all the unit test I could come up with were not triggering the bug.

This was tested against the reproduce example in the issue setting the env var PYTHONPATH.

@jdavid
Copy link
Member

jdavid commented Oct 4, 2022

Good catch!
The correct solution is to Py_INCREF(Py_None) when it is assigned. That's what we do in other places, and what is done in Python's core. Please update the PR.

@siscia
Copy link
Contributor Author

siscia commented Oct 4, 2022

Wonderful I will try to follow up tonight!

@siscia
Copy link
Contributor Author

siscia commented Oct 4, 2022

Addressed!

Let me know if you need me to squash the commits or to fix the history somehow!

@jdavid
Copy link
Member

jdavid commented Oct 4, 2022

Yes please, squash the commits.

@siscia
Copy link
Contributor Author

siscia commented Oct 4, 2022

Done!

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.

None yet

2 participants