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

Add PyMapping_HasKeyWithError() function #73

Merged
merged 2 commits into from
Sep 19, 2023
Merged

Add PyMapping_HasKeyWithError() function #73

merged 2 commits into from
Sep 19, 2023

Conversation

vstinner
Copy link
Member

Add PyMapping_HasKeyWithError() and PyMapping_HasKeyStringWithError() functions.

Fix also undefined behavior in PyMapping_GetOptionalItemString() when PyUnicode_FromString() fails: set '*result' to NULL.

Add PyMapping_HasKeyWithError() and PyMapping_HasKeyStringWithError()
functions.

Fix also undefined behavior in PyMapping_GetOptionalItemString() when
PyUnicode_FromString() fails: set '*result' to NULL.
@vstinner
Copy link
Member Author

cc @serhiy-storchaka

@vstinner
Copy link
Member Author

Then I will add:

  • PyObject_HasAttrWithError()
  • PyObject_HasAttrStringWithError()

Comment on lines 53 to 54
// Marker to check that pointer value was set
#define UNINITIALIZED_OBJ ((PyObject *)"uninitialized")
Copy link
Member

Choose a reason for hiding this comment

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

@vstinner vstinner merged commit 309c56d into main Sep 19, 2023
21 checks passed
@vstinner vstinner deleted the mapping_hasattr branch September 19, 2023 12:03
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.

2 participants