gnucash maint: Bug 796858 - TypeError: in method 'qof_query_int32_predicate', ...

John Ralls jralls at code.gnucash.org
Tue Sep 18 13:41:23 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/0cf42a75 (commit)
	from  https://github.com/Gnucash/gnucash/commit/10811b8a (commit)



commit 0cf42a75b338c003c4ff9d98f48dd71126bfa5e8
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Sep 18 10:21:09 2018 -0700

    Bug 796858 - TypeError: in method 'qof_query_int32_predicate',...
    
    argument 2 of type 'gint32' on gnucash.gnucash_core.QueryInt32Predicate
    
    Add gint32 to typemap.
    Also replace a couple of PyString_ calls leftover from Py2.

diff --git a/common/base-typemaps.i b/common/base-typemaps.i
index 5b410c1..f53ed09 100644
--- a/common/base-typemaps.i
+++ b/common/base-typemaps.i
@@ -178,6 +178,7 @@ typedef char gchar;
 %apply int { gint };
 %apply unsigned int { guint };
 %apply long { glong };
+%apply int32_t { gint32 };
 %apply int64_t { gint64 };
 %apply unsigned long { gulong };
 %apply uint64_t { guint64 };
@@ -250,8 +251,8 @@ typedef char gchar;
         int size = PyList_Size($input);
         for (i = size-1; i >= 0; i--) {
             PyObject *o = PyList_GetItem($input, i);
-            if (PyString_Check(o)) {
-                $1 = g_slist_prepend($1,PyString_AsString(PyList_GetItem($input, i)));
+            if (PyUnicode_Check(o)) {
+                $1 = g_slist_prepend($1,PyUnicode_AsUTF8(PyList_GetItem($input, i)));
             } else {
                 PyErr_SetString(PyExc_TypeError, "list must contain strings");
                 g_slist_free($1);



Summary of changes:
 common/base-typemaps.i | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list