Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commented Apr 8, 2023

@erlend-aaslanderlend-aasland marked this pull request as draft April 8, 2023 22:35
@erlend-aaslanderlend-aasland marked this pull request as ready for review April 8, 2023 23:03
@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commented Apr 10, 2023

Darn, I forgot to add error handling for PyDict_SetItemString. I'll create a follow-up PR for that: gh-103420

Comment on lines +673 to +676
if (version==NULL){
goto error;
}
st=PyModule_AddObjectRef(m, "CRT_ASSEMBLY_VERSION", version);
Copy link
Member

Choose a reason for hiding this comment

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

@erlend-aasland Just FYI, the modsupport functions allow passing in NULL provided an error has already occurred, and they just let it chain. So the code here was fine before.

No need to revert now though.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

TIL! Sorry for not waiting on your review.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

However, there was a leak if PyModule_AddObject failed, since that API only eat refs if successful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I should have been more careful in this.

warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Apr 18, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@zooba@kumaraditya303@bedevere-bot