From 9aaf9e7e1ccd5dca801beb5dc83428d0e88e7e76 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 29 Oct 2023 00:33:57 +0800 Subject: [PATCH] [gnucash-commands.cpp] better python_cleanup --- gnucash/gnucash-commands.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnucash/gnucash-commands.cpp b/gnucash/gnucash-commands.cpp index d0849092726..83c4de4457f 100644 --- a/gnucash/gnucash-commands.cpp +++ b/gnucash/gnucash-commands.cpp @@ -586,10 +586,10 @@ python_cleanup (PyConfig& config, PyStatus& status) gnc_clear_current_session (); PyConfig_Clear(&config); - if (PyStatus_IsExit(status)) - gnc_shutdown_cli (status.exitcode); - - gnc_shutdown_cli (0); + if (status.err_msg && *status.err_msg) + std::cerr << bl::format (_("Python Config failed with error {1}")) % status.err_msg + << std::endl; + gnc_shutdown_cli (status.exitcode); } static void