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

gh-125517: Fix unreachable code warnings in _testembed.c #125518

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 15, 2024

@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

Doc/c-api/init_config.rst Show resolved Hide resolved
@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