diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2008-06-09 19:42:28 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2008-06-09 19:42:28 +0000 |
commit | ac00f4306e17c0f6685d657b5cd183c7171f14db (patch) | |
tree | 98f04b0ec24eb82a3d714096a4295b11bcf23eee /gobject/pygobject.c | |
parent | 6e8350d42097d8683c9d64be19dff9ab9805bb0a (diff) | |
download | pygobject-ac00f4306e17c0f6685d657b5cd183c7171f14db.tar.gz pygobject-ac00f4306e17c0f6685d657b5cd183c7171f14db.tar.xz pygobject-ac00f4306e17c0f6685d657b5cd183c7171f14db.zip |
New functions, unconditionally raise TypeError. (pygobject_methods): Hook
2008-06-09 Paul Pogonyshev <pogonyshev@gmx.net>
* gobject/pygobject.c (pygobject_copy, pygobject_deepcopy): New
functions, unconditionally raise TypeError.
(pygobject_methods): Hook them up. (bug #482370)
svn path=/trunk/; revision=787
Diffstat (limited to 'gobject/pygobject.c')
-rw-r--r-- | gobject/pygobject.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 0754984..4563500 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1865,6 +1865,24 @@ pygobject_weak_ref(PyGObject *self, PyObject *args) return retval; } + +static PyObject * +pygobject_copy(PyGObject *self) +{ + PyErr_SetString(PyExc_TypeError, + "gobject.GObject descendants' instances are non-copyable"); + return NULL; +} + +static PyObject * +pygobject_deepcopy(PyGObject *self, PyObject *args) +{ + PyErr_SetString(PyExc_TypeError, + "gobject.GObject descendants' instances are non-copyable"); + return NULL; +} + + static PyObject * pygobject_disconnect_by_func(PyGObject *self, PyObject *args) { @@ -1990,6 +2008,8 @@ static PyMethodDef pygobject_methods[] = { { "emit_stop_by_name", (PyCFunction)pygobject_stop_emission,METH_VARARGS }, { "chain", (PyCFunction)pygobject_chain_from_overridden,METH_VARARGS }, { "weak_ref", (PyCFunction)pygobject_weak_ref, METH_VARARGS }, + { "__copy__", (PyCFunction)pygobject_copy, METH_NOARGS }, + { "__deepcopy__", (PyCFunction)pygobject_deepcopy, METH_VARARGS }, { NULL, NULL, 0 } }; |