From 681d0271de46e11844ab1001d56f86fb02c8e475 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 16 Sep 2017 11:29:43 -0700 Subject: [PATCH] Fix python init errors. --- gnucash/python/gncmod-python.c | 3 ++- gnucash/python/init.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gnucash/python/gncmod-python.c b/gnucash/python/gncmod-python.c index 5bec5a95e2..d360de96a7 100644 --- a/gnucash/python/gncmod-python.c +++ b/gnucash/python/gncmod-python.c @@ -73,8 +73,9 @@ libgncmod_python_gnc_module_init(int refcount) */ FILE *fp; gchar *pkgdatadir, *init_filename; - + char* argv = ""; Py_Initialize(); + PySys_SetArgv(0, &argv); #if PY_VERSION_HEX >= 0x03000000 PyInit__sw_app_utils(); PyInit__sw_core_utils(); diff --git a/gnucash/python/init.py b/gnucash/python/init.py index e62e6b577b..85febecc26 100644 --- a/gnucash/python/init.py +++ b/gnucash/python/init.py @@ -2,6 +2,8 @@ import sys import _sw_app_utils from gnucash import * from _sw_core_utils import gnc_prefs_is_extra_enabled +from gi import require_version +require_version('Gtk', '3.0') from gi.repository import Gtk import os sys.path.append(os.path.dirname(__file__))