[pybank] Fix passing args when the func is a method



commit 341b54ab389e72186ee53a6dcc9580497a7d093c
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Fri May 8 14:39:13 2009 +0200

    Fix passing args when the func is a method
---
 bank/bank-info.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/bank/bank-info.c b/bank/bank-info.c
index 21ecd6c..15956b0 100644
--- a/bank/bank-info.c
+++ b/bank/bank-info.c
@@ -434,7 +434,10 @@ _wrap_g_function_info_invoke(PyGIBaseInfo *self, PyObject *args)
         }
 
         if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) {
-            py_arg = PyTuple_GetItem(args, i);
+            if (is_method)
+                py_arg = PyTuple_GetItem(args, i + 1);
+            else
+                py_arg = PyTuple_GetItem(args, i);
 	    GArgument in_value = pyg_argument_from_pyobject(py_arg, g_arg_info_get_type(arg_info));
 
             ++argv_pos;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]