From ac00f4306e17c0f6685d657b5cd183c7171f14db Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Mon, 9 Jun 2008 19:42:28 +0000 Subject: New functions, unconditionally raise TypeError. (pygobject_methods): Hook 2008-06-09 Paul Pogonyshev * gobject/pygobject.c (pygobject_copy, pygobject_deepcopy): New functions, unconditionally raise TypeError. (pygobject_methods): Hook them up. (bug #482370) svn path=/trunk/; revision=787 --- gobject/pygobject.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gobject/pygobject.c') 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 } }; -- cgit