pygobject r787 - in trunk: . gobject



Author: paulp
Date: Mon Jun  9 19:42:28 2008
New Revision: 787
URL: http://svn.gnome.org/viewvc/pygobject?rev=787&view=rev

Log:
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)


Modified:
   trunk/ChangeLog
   trunk/gobject/pygobject.c

Modified: trunk/gobject/pygobject.c
==============================================================================
--- trunk/gobject/pygobject.c	(original)
+++ trunk/gobject/pygobject.c	Mon Jun  9 19:42:28 2008
@@ -1865,6 +1865,24 @@
     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 @@
     { "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 }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]