summaryrefslogtreecommitdiff
path: root/gobject/gobjectmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'gobject/gobjectmodule.c')
-rw-r--r--gobject/gobjectmodule.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 3067b205..b5b99ce8 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -967,7 +967,13 @@ pyg_closure_new(PyObject *callback, PyObject *extra_args, PyObject *swap_data)
Py_INCREF(callback);
((PyGClosure *)closure)->callback = callback;
if (extra_args) {
- Py_INCREF(extra_args);
+ if (!PyTuple_Check(extra_args)) {
+ PyObject *tmp = PyTuple_New(1);
+ PySequence_SetItem(tmp, 0, extra_args);
+ extra_args = Py_BuildValue(tmp);
+ } else {
+ Py_INCREF(extra_args);
+ }
((PyGClosure *)closure)->extra_args = extra_args;
}
if (swap_data) {