diff options
| author | Christoph Reiter <reiter.christoph@gmail.com> | 2014-04-14 23:33:52 +0200 |
|---|---|---|
| committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-04-14 19:15:19 -0700 |
| commit | 3a2bfc8bf01fcae386355bc3652780e198e54d49 (patch) | |
| tree | 4cd437debaa53325c1e8720819f12ef6cf4b9b6f /gi/pygi-boxed.c | |
| parent | 906977047df2fb2f394410e4ebf360b69af8dcfe (diff) | |
| download | pygobject-3a2bfc8bf01fcae386355bc3652780e198e54d49.tar.gz | |
Raise TypeError if arguments are passed to Boxed.__init__
This is a partial revert of
https://git.gnome.org/browse/pygobject/commit/?id=2f2069c9efcd8
which removed a type check in __new__. This adds it back
into __init__. Overrides which define __new__ now have to
filter out any arguments in __init__ and not the other way
around, which is a bit less surprising in the common case.
https://bugzilla.gnome.org/show_bug.cgi?id=727810
Diffstat (limited to 'gi/pygi-boxed.c')
| -rw-r--r-- | gi/pygi-boxed.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c index 06324fdb..c52858bb 100644 --- a/gi/pygi-boxed.c +++ b/gi/pygi-boxed.c @@ -123,6 +123,12 @@ _boxed_init (PyObject *self, PyObject *args, PyObject *kwargs) { + static char *kwlist[] = { NULL }; + + if (!PyArg_ParseTupleAndKeywords (args, kwargs, "", kwlist)) { + return -1; + } + /* Don't call PyGBoxed's init, which raises an exception. */ return 0; } |
