diff options
author | Steve Frécinaux <code@istique.net> | 2010-06-07 09:47:23 +0200 |
---|---|---|
committer | Steve Frécinaux <code@istique.net> | 2010-06-09 10:04:09 +0200 |
commit | 07df124dc06cf506634e95d08397f50a2d07fce2 (patch) | |
tree | d549b9fcfd2a20861273e4b73809f0155efa4c22 /gi/pygi-invoke.c | |
parent | b435319fe830a909cc4d414533b3b66574931e24 (diff) | |
download | pygobject-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.c | 3 |
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; } |