gnucash master: Fix python init errors.

John Ralls jralls at code.gnucash.org
Sat Sep 16 14:30:24 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/681d0271 (commit)
	from  https://github.com/Gnucash/gnucash/commit/2ac118f8 (commit)



commit 681d0271de46e11844ab1001d56f86fb02c8e475
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Sep 16 11:29:43 2017 -0700

    Fix python init errors.

diff --git a/gnucash/python/gncmod-python.c b/gnucash/python/gncmod-python.c
index 5bec5a9..d360de9 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 e62e6b5..85febec 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__))



Summary of changes:
 gnucash/python/gncmod-python.c | 3 ++-
 gnucash/python/init.py         | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list