]> granicus.if.org Git - python/commitdiff
bpo-37369: Fixes crash when reporting fatal error (GH-14468)
authorSteve Dower <steve.dower@python.org>
Sat, 29 Jun 2019 21:28:43 +0000 (14:28 -0700)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2019 21:28:43 +0000 (14:28 -0700)
PC/python_uwp.cpp

index 73e0d82e5503108a43bef655283d7c4f635631c3..2352f45e8a3d2a196623519063b87b77873f70fb 100644 (file)
@@ -166,12 +166,12 @@ wmain(int argc, wchar_t **argv)
     PyPreConfig_InitPythonConfig(&preconfig);
     status = Py_PreInitializeFromArgs(&preconfig, argc, argv);
     if (PyStatus_Exception(status)) {
-        goto fail;
+        goto fail_without_config;
     }
 
     status = PyConfig_InitPythonConfig(&config);
     if (PyStatus_Exception(status)) {
-        goto fail;
+        goto fail_without_config;
     }
 
     status = PyConfig_SetArgv(&config, argc, argv);
@@ -233,6 +233,7 @@ wmain(int argc, wchar_t **argv)
 
 fail:
     PyConfig_Clear(&config);
+fail_without_config:
     if (PyStatus_IsExit(status)) {
         return status.exitcode;
     }