Skip to content

Commit ac14632

Browse files
authored
bpo-37369: Fixes crash when reporting fatal error (GH-14468)
1 parent 9048c49 commit ac14632

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PC/python_uwp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ wmain(int argc, wchar_t **argv)
166166
PyPreConfig_InitPythonConfig(&preconfig);
167167
status = Py_PreInitializeFromArgs(&preconfig, argc, argv);
168168
if (PyStatus_Exception(status)) {
169-
goto fail;
169+
goto fail_without_config;
170170
}
171171

172172
status = PyConfig_InitPythonConfig(&config);
173173
if (PyStatus_Exception(status)) {
174-
goto fail;
174+
goto fail_without_config;
175175
}
176176

177177
status = PyConfig_SetArgv(&config, argc, argv);
@@ -233,6 +233,7 @@ wmain(int argc, wchar_t **argv)
233233

234234
fail:
235235
PyConfig_Clear(&config);
236+
fail_without_config:
236237
if (PyStatus_IsExit(status)) {
237238
return status.exitcode;
238239
}

0 commit comments

Comments
 (0)