mirror of
https://github.com/python/cpython.git
synced 2025-11-09 06:01:05 +00:00
gh-125517: Fix unreachable code warnings in _testembed.c (#125518)
This commit is contained in:
parent
cc5a225cdc
commit
c8a1818fb0
2 changed files with 22 additions and 14 deletions
|
|
@ -1825,15 +1825,19 @@ return ``-1`` on error:
|
||||||
PyInitConfig_Free(config);
|
PyInitConfig_Free(config);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Display the error message
|
|
||||||
const char *err_msg;
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
|
// Display the error message
|
||||||
|
// This uncommon braces style is used, because you cannot make
|
||||||
|
// goto targets point to variable declarations.
|
||||||
|
const char *err_msg;
|
||||||
(void)PyInitConfig_GetError(config, &err_msg);
|
(void)PyInitConfig_GetError(config, &err_msg);
|
||||||
printf("PYTHON INIT ERROR: %s\n", err_msg);
|
printf("PYTHON INIT ERROR: %s\n", err_msg);
|
||||||
PyInitConfig_Free(config);
|
PyInitConfig_Free(config);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Runtime Python configuration API
|
Runtime Python configuration API
|
||||||
|
|
|
||||||
|
|
@ -1902,11 +1902,13 @@ static int test_initconfig_api(void)
|
||||||
Py_Finalize();
|
Py_Finalize();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const char *err_msg;
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
|
const char *err_msg;
|
||||||
(void)PyInitConfig_GetError(config, &err_msg);
|
(void)PyInitConfig_GetError(config, &err_msg);
|
||||||
printf("Python init failed: %s\n", err_msg);
|
printf("Python init failed: %s\n", err_msg);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2050,11 +2052,13 @@ static int test_initconfig_module(void)
|
||||||
Py_Finalize();
|
Py_Finalize();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const char *err_msg;
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
|
const char *err_msg;
|
||||||
(void)PyInitConfig_GetError(config, &err_msg);
|
(void)PyInitConfig_GetError(config, &err_msg);
|
||||||
printf("Python init failed: %s\n", err_msg);
|
printf("Python init failed: %s\n", err_msg);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue