summaryrefslogtreecommitdiff
path: root/gi/pygi-object.c
diff options
context:
space:
mode:
authorArjan Molenaar <gaphor@gmail.com>2021-08-03 17:43:45 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2022-03-28 06:47:29 +0200
commit066223dab7b9c10543d88cb04c64f76fe4d7815d (patch)
treeae36b8e28c6a222aaa95e4d507e7a29723f7fadb /gi/pygi-object.c
parentaeb85b296080a886fb71fc8b164c0760bae5bd0e (diff)
downloadpygobject-066223dab7b9c10543d88cb04c64f76fe4d7815d.tar.gz
Check object type before Python objects are created
Diffstat (limited to 'gi/pygi-object.c')
-rw-r--r--gi/pygi-object.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gi/pygi-object.c b/gi/pygi-object.c
index 00b36c1b..1ceab24d 100644
--- a/gi/pygi-object.c
+++ b/gi/pygi-object.c
@@ -235,10 +235,14 @@ pygi_arg_gobject_to_py (GIArgument *arg, GITransfer transfer) {
if (transfer == GI_TRANSFER_EVERYTHING)
g_param_spec_unref (arg->v_pointer);
- } else {
+ } else if (G_IS_OBJECT(arg->v_pointer)) {
pyobj = pygobject_new_full (arg->v_pointer,
/*steal=*/ transfer == GI_TRANSFER_EVERYTHING,
/*type=*/ NULL);
+ } else {
+ g_warning("No means to translate argument or return value for '%s'", g_type_name_from_instance(arg->v_pointer));
+ pyobj = Py_None;
+ Py_INCREF (pyobj);
}
return pyobj;