File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -1825,14 +1825,18 @@ return ``-1`` on error:
1825
1825
PyInitConfig_Free(config);
1826
1826
return 0;
1827
1827
1828
- // Display the error message
1829
- const char *err_msg;
1830
1828
error:
1831
- (void)PyInitConfig_GetError(config, &err_msg);
1832
- printf("PYTHON INIT ERROR: %s\n", err_msg);
1833
- PyInitConfig_Free(config);
1829
+ {
1830
+ // Display the error message
1831
+ // This uncommon braces style is used, because you cannot make
1832
+ // goto targets point to variable declarations.
1833
+ const char *err_msg;
1834
+ (void)PyInitConfig_GetError(config, &err_msg);
1835
+ printf("PYTHON INIT ERROR: %s\n", err_msg);
1836
+ PyInitConfig_Free(config);
1834
1837
1835
- return -1;
1838
+ return -1;
1839
+ }
1836
1840
}
1837
1841
1838
1842
Original file line number Diff line number Diff line change @@ -1902,11 +1902,13 @@ static int test_initconfig_api(void)
1902
1902
Py_Finalize ();
1903
1903
return 0 ;
1904
1904
1905
- const char * err_msg ;
1906
1905
error :
1907
- (void )PyInitConfig_GetError (config , & err_msg );
1908
- printf ("Python init failed: %s\n" , err_msg );
1909
- exit (1 );
1906
+ {
1907
+ const char * err_msg ;
1908
+ (void )PyInitConfig_GetError (config , & err_msg );
1909
+ printf ("Python init failed: %s\n" , err_msg );
1910
+ exit (1 );
1911
+ }
1910
1912
}
1911
1913
1912
1914
@@ -2050,11 +2052,13 @@ static int test_initconfig_module(void)
2050
2052
Py_Finalize ();
2051
2053
return 0 ;
2052
2054
2053
- const char * err_msg ;
2054
2055
error :
2055
- (void )PyInitConfig_GetError (config , & err_msg );
2056
- printf ("Python init failed: %s\n" , err_msg );
2057
- exit (1 );
2056
+ {
2057
+ const char * err_msg ;
2058
+ (void )PyInitConfig_GetError (config , & err_msg );
2059
+ printf ("Python init failed: %s\n" , err_msg );
2060
+ exit (1 );
2061
+ }
2058
2062
}
2059
2063
2060
2064
You can’t perform that action at this time.
0 commit comments