Skip to content

bpo-42006: Stop using PyDict_GetItemString() #23487

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

Closed

Conversation

hongweipeng
Copy link
Contributor

@hongweipeng hongweipeng commented Nov 24, 2020

This is a complement to that PR #22648.

https://bugs.python.org/issue42006

@@ -1050,7 +1050,7 @@ _PyConfig_AsDict(const PyConfig *config)
static PyObject*
config_dict_get(PyObject *dict, const char *name)
{
PyObject *item = PyDict_GetItemString(dict, name);
PyObject *item = PyMapping_GetItemString(dict, name);
Copy link
Member

Choose a reason for hiding this comment

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

PyDict_GetItemString returns a borrowed reference, PyMapping_GetItemString returns an owned reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reminding, it has been replaced by PyMapping_GetItemString.

@serhiy-storchaka
Copy link
Member

There are other issues in this code. See #23488.

@hongweipeng
Copy link
Contributor Author

Superseded by #23488.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants