diff options
| author | Christoph Reiter <reiter.christoph@gmail.com> | 2014-08-22 21:51:31 -0700 |
|---|---|---|
| committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-08-22 21:51:31 -0700 |
| commit | 27a14679dce33f64bbb5d77677eba83849f168ff (patch) | |
| tree | 9a92261d9b5409f103bb02f2e87963db55a9753c /gi/pygi-boxed.c | |
| parent | 6008748bd7ecc6e5c933e6902c77d8485b905a6f (diff) | |
| download | pygobject-27a14679dce33f64bbb5d77677eba83849f168ff.tar.gz | |
Change boxed init with args to warn instead of raise
Replace raising a TypeError in gi.types.Boxed() with a warning.
Even though passing arguments or keywords to the parent class is
incorrect here, raising an exception was causing a bit of fallout
in some apps (Gramps).
https://bugzilla.gnome.org/show_bug.cgi?id=727810
Diffstat (limited to 'gi/pygi-boxed.c')
| -rw-r--r-- | gi/pygi-boxed.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c index 557584b5..a1494b61 100644 --- a/gi/pygi-boxed.c +++ b/gi/pygi-boxed.c @@ -134,7 +134,10 @@ _boxed_init (PyObject *self, static char *kwlist[] = { NULL }; if (!PyArg_ParseTupleAndKeywords (args, kwargs, "", kwlist)) { - return -1; + PyErr_Clear (); + PyErr_Warn (PyExc_TypeError, + "Passing arguments to gi.types.Boxed.__init__() is deprecated. " + "All arguments passed will be ignored."); } /* Don't call PyGBoxed's init, which raises an exception. */ |
