summaryrefslogtreecommitdiff
path: root/gi/pygi-invoke.c
diff options
context:
space:
mode:
authorSteve Frécinaux <code@istique.net>2010-06-07 09:47:23 +0200
committerSteve Frécinaux <code@istique.net>2010-06-09 10:04:09 +0200
commit07df124dc06cf506634e95d08397f50a2d07fce2 (patch)
treed549b9fcfd2a20861273e4b73809f0155efa4c22 /gi/pygi-invoke.c
parentb435319fe830a909cc4d414533b3b66574931e24 (diff)
downloadpygobject-07df124dc06cf506634e95d08397f50a2d07fce2.tar.gz
Make the "wrong argument count" exception more explicit.
Previously we had messages like this one: TypeError: takes exactly 2 argument(s) (1 given) With this patch, they become like this: TypeError: get_end_iter() takes exactly 2 argument(s) (1 given) It makes things much easier to debug when there are several pygi calls on the same line. https://bugzilla.gnome.org/show_bug.cgi?id=620804
Diffstat (limited to 'gi/pygi-invoke.c')
-rw-r--r--gi/pygi-invoke.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c
index 7ac1685d..63e57e79 100644
--- a/gi/pygi-invoke.c
+++ b/gi/pygi-invoke.c
@@ -233,7 +233,8 @@ _prepare_invocation_state (struct invocation_state *state,
if (state->n_py_args != n_py_args_expected) {
PyErr_Format (PyExc_TypeError,
- "takes exactly %zd argument(s) (%zd given)",
+ "%s() takes exactly %zd argument(s) (%zd given)",
+ g_base_info_get_name ( (GIBaseInfo *) function_info),
n_py_args_expected, state->n_py_args);
return FALSE;
}