Skip to content

Commit

Permalink
pythongh-125517: Fix unreachable code warnings in _testembed.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Oct 15, 2024
1 parent 92af191 commit 02415d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,8 @@ static int test_initconfig_api(void)
return 1;
}

const char *err_msg;

if (PyInitConfig_SetInt(config, "configure_locale", 1) < 0) {
goto error;
}
Expand Down Expand Up @@ -1901,7 +1903,6 @@ static int test_initconfig_api(void)
Py_Finalize();
return 0;

const char *err_msg;
error:
(void)PyInitConfig_GetError(config, &err_msg);
printf("Python init failed: %s\n", err_msg);
Expand Down Expand Up @@ -2027,6 +2028,8 @@ static int test_initconfig_module(void)
return 1;
}

const char *err_msg;

if (PyInitConfig_SetStr(config, "program_name", PROGRAM_NAME_UTF8) < 0) {
goto error;
}
Expand All @@ -2049,7 +2052,6 @@ static int test_initconfig_module(void)
Py_Finalize();
return 0;

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

0 comments on commit 02415d9

Please sign in to comment.