Skip to content

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 15, 2024

@sobolevn sobolevn requested a review from vstinner October 15, 2024 12:26
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Oct 15, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Please update also the documentation: https://docs.python.org/dev/c-api/init_config.html#id1

Yeah, it's annoying, it's not possible to declare err_msg in the error label :-(

@vstinner
Copy link
Member

An alternative is to use braces to declare a local scope:

error:
    {
        const char *err_msg;
        (void)PyInitConfig_GetError(config, &err_msg);
        printf("Python init failed: %s\n", err_msg);
    }
    ...

@sobolevn
Copy link
Member Author

I like the braces idea! Will do. Thanks for the quick review!

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@sobolevn
Copy link
Member Author

Thanks! Addressed the last comment as well.

@sobolevn sobolevn enabled auto-merge (squash) October 15, 2024 12:47
@sobolevn sobolevn merged commit c8a1818 into python:main Oct 15, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants