Skip to content

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
@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