From 0cf42a75b338c003c4ff9d98f48dd71126bfa5e8 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 18 Sep 2018 10:21:09 -0700 Subject: [PATCH] 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. --- common/base-typemaps.i | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/base-typemaps.i b/common/base-typemaps.i index 5b410c19b5..f53ed09676 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);