-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Conversation
There was a problem hiding this 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 :-(
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);
}
... |
I like the braces idea! Will do. Thanks for the quick review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! Addressed the last comment as well. |
CC @vstinner as the author of ef9d547
_testembed.c
#125517