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
MemberAuthor

cc @serhiy-storchaka

@vstinner
Copy link
MemberAuthor

Then I will add:

  • PyObject_HasAttrWithError()
  • PyObject_HasAttrStringWithError()

Comment on lines 53 to 54
// Marker to check that pointer value was set
#defineUNINITIALIZED_OBJ ((PyObject *)"uninitialized")

Choose a reason for hiding this comment

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

@vstinnervstinner merged commit 309c56d into mainSep 19, 2023
@vstinnervstinner deleted the mapping_hasattr branch September 19, 2023 12:03
Sign up for freeto 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

@vstinner@serhiy-storchaka